﻿army_finances_button = {
	name = "army_finances_button"
	desc = "army_finances_button_desc"

	visible = {
	NOT = {				
				has_variable = army_finances_var
				has_modifier = amir_kabir_reforms_modifier
				has_modifier = amir_kabir_darolfonoon_modifier
				has_variable = amir_kabir_killed_var
			}
			has_variable = amir_kabir_spawns_var
	}

	possible = {
	produced_bureaucracy > 100
	}

	effect = {			
	custom_tooltip = historical_tt
	custom_tooltip = army_finances_tt
		add_modifier = {
			name = army_finances_modifier
			months = 12
			}
			 add_journal_entry = {
        	type = je_army_finances
        }
				set_variable = {
			name = army_finances_timer_var
			value = 0
		}	
		
		set_variable = {
		name = army_finances_var
		value = yes		
			}

		}
	
	ai_chance = {
		base = 100
		}
}

execute_the_bab_button = {
	name = "execute_the_bab_button"
	desc = "execute_the_bab_button_desc"

	visible = {
	NOT = {
		has_variable = bab_execution_attempt_var
		}
	}

	possible = {
	custom_tooltip = {
				text = mohammad_shah_alive_tt
	ruler = {
		NOT = {
			has_template = per_mohammad_shah_qajar_template
				}
			}
		}
	}

	effect = {
	custom_tooltip = historical_tt
	trigger_event = { id = 03_persia_events.74 popup = yes } #The Bab Firing Squad
		set_variable = bab_execution_attempt_var
		}	
	
	ai_chance = {
		base = 100
		}
}

prepare_the_crown_prince_button = {
	name = "prepare_the_crown_prince_button"
	desc = "prepare_the_crown_prince_button_desc"

	visible = {
	NOT = { has_global_variable = prepare_crown_prince_var }
	}

	possible = {
	OR = {
	year = 1847
		ruler = {
				has_trait = deathly_ill
				}
		ruler = {
				has_trait = severly_ill
				}
		}
	}

	effect = {
	custom_tooltip = historical_tt
	trigger_event = { id = 03_persia_events.3 popup = yes } #Prepare the Crown Prince
		}	
	
	ai_chance = {
		base = 100
		}
}

ornate_bureaucracy_button = {
	name = "ornate_bureaucracy_button"
	desc = "ornate_bureaucracy_button_desc"

	visible = {
	NOT = {				
				has_variable = ornate_bureaucracy_var
				has_modifier = amir_kabir_reforms_modifier
				has_modifier = amir_kabir_darolfonoon_modifier
				has_variable = amir_kabir_killed_var
			}
	}

	possible = {
	#has_technology_researched = central_archives
			produced_bureaucracy > 300
			OR = {
			hidden_effect = {
			is_player = no
			}
			AND = {
			government_legitimacy >= 25
			ig:ig_intelligentsia = {
            is_in_government = yes
				}
				ig:ig_landowners = {
				is_in_government = no
				}
			}
		}
	}

	effect = {
	custom_tooltip = historical_tt
	custom_tooltip = reform_persia_advance
		add_modifier = {
			name = amir_kabir_reforms_modifier
			months = 5
			}
			 add_journal_entry = {
        	type = je_ornate_bureaucracy
        }
				set_variable = {
			name = ornate_bureaucracy_timer_var
			value = 0
		}	
		
		set_variable = {
		name = ornate_bureaucracy_var
		value = yes		
			}

		}	
	
	ai_chance = {
		base = 100
		}
}

curb_royal_spending_button = {
	name = "curb_royal_spending_button"
	desc = "curb_royal_spending_button_desc"

	visible = {
	NOT = {				
				has_variable = curb_royal_spending_var
				has_modifier = amir_kabir_reforms_modifier
				has_modifier = amir_kabir_darolfonoon_modifier
				has_variable = amir_kabir_killed_var
			}
	}

	possible = {
	produced_bureaucracy > 300
			OR = {
			hidden_effect = {
			is_player = no
			}
			AND = {
			government_legitimacy >= 25
			ig:ig_intelligentsia = {
            is_in_government = yes
				}
				ig:ig_landowners = {
            is_in_government = no
				}
			}
		}	
	}

	effect = {
	custom_tooltip = historical_tt
	custom_tooltip = reform_persia_advance
	
		add_modifier = {
			name = amir_kabir_reforms_modifier
			months = 5
			}
			 add_journal_entry = {
        	type = je_curb_royal_spending
        }
				set_variable = {
			name = curb_royal_spending_timer_var
			value = 0
		}	
		
		set_variable = {
		name = curb_royal_spending_var
		value = yes		
			}	
	}
}

establish_newspaper_button = {
	name = "establish_newspaper_button"
	desc = "establish_newspaper_button_desc"

	visible = {
	NOT = {				
				has_variable = establish_newspaper_var
				has_modifier = amir_kabir_paying_reforms_modifier
				has_modifier = amir_kabir_darolfonoon_modifier
				has_variable = amir_kabir_killed_var
			}
	}

	possible = {
	has_technology_researched = mass_communication
	OR = {
			hidden_effect = {
			is_player = no
			}
			AND = {
			government_legitimacy >= 25
			ig:ig_intelligentsia = {
            is_in_government = yes
				}
				ig:ig_landowners = {
            is_in_government = no
				}
			}
		}	
	}

	effect = {
	custom_tooltip = historical_tt	
	custom_tooltip = reform_persia_advance	
		add_modifier = {
			name = amir_kabir_paying_reforms_modifier
			multiplier = money_amount_multiplier_very_large
			months = 5
		}
			 add_journal_entry = {
        	type = je_establish_newspaper
        }
					
		
		set_variable = {
		name = establish_newspaper_var
		value = yes		
			}	
	}
	ai_chance = {
		base = 100
		}
}

smallpox_vaccines_button = {
	name = "smallpox_vaccines_button"
	desc = "smallpox_vaccines_button_desc"

	visible = {
	NOT = {				
				has_variable = smallpox_vaccines_var
				has_modifier = amir_kabir_paying_reforms_modifier
				has_modifier = amir_kabir_darolfonoon_modifier
				has_variable = amir_kabir_killed_var
			}
	}

	possible = {
	has_technology_researched = medical_degrees
	OR = {
			hidden_effect = {
			is_player = no
			}
			AND = {
			government_legitimacy >= 25
			ig:ig_intelligentsia = {
            is_in_government = yes
				}
				ig:ig_landowners = {
            is_in_government = no
				}
			}
		}	
	}

	effect = {
	custom_tooltip = historical_tt	
	custom_tooltip = reform_persia_advance	
	
		add_modifier = {
			name = amir_kabir_paying_reforms_modifier
			multiplier = money_amount_multiplier_very_large
			months = 5
		}
			 add_journal_entry = {
        	type = je_smallpox_vaccines
        }
				set_variable = {
			name = smallpox_vaccines_timer_var
			value = 0
		}	
		
		set_variable = {
		name = smallpox_vaccines_var
		value = yes		
			}	
	}
	ai_chance = {
		base = 100
		}
}

negative_equilibrium_button = {
	name = "negative_equilibrium_button"
	desc = "negative_equilibrium_button_desc"

	visible = {
	NOT = {				
				has_variable = negative_equilibrium_var
				has_modifier = amir_kabir_reforms_modifier
				has_modifier = amir_kabir_darolfonoon_modifier
				has_variable = amir_kabir_killed_var
			}
	}

	possible = {
	produced_bureaucracy > 300
			OR = {
			hidden_effect = {
			is_player = no
			}
			AND = {
			government_legitimacy >= 25
			ig:ig_intelligentsia = {
            is_in_government = yes
				}
			ig:ig_landowners = {
            is_in_government = no
				}
			}
		}	
	}

	effect = {
	custom_tooltip = historical_tt
	custom_tooltip = reform_persia_advance
		add_modifier = {
			name = amir_kabir_reforms_modifier
			months = 5
			}
			 add_journal_entry = {
        	type = je_negative_equilibrium
        }
				set_variable = {
			name = negative_equilibrium_timer_var
			value = 0
		}	
		
		set_variable = {
		name = negative_equilibrium_var
		value = yes		
			}	
	}
	
	ai_chance = {
		base = 100
		}
}

dar-ol-fonoon_button = {
	name = "dar-ol-fonoon_button"
	desc = "dar-ol-fonoon_button_desc"

	visible = {
	NOT = {				
				has_variable = darolfonoon_started_var
				has_modifier = amir_kabir_reforms_modifier
				has_modifier = amir_kabir_paying_reforms_modifier
				has_variable = amir_kabir_killed_var
			}
	}

	possible = {
	has_technology_researched = empiricism
	custom_tooltip = {
		text = darolfonoon_possible_tt
		has_variable = ornate_bureaucracy_var	
		has_variable = curb_royal_spending_var	
		has_variable = smallpox_vaccines_var	
		has_variable = negative_equilibrium_var
		has_variable = establish_newspaper_var		
			}
		OR = {
			hidden_effect = {
			is_player = no
			}
			AND = {
			government_legitimacy >= 25
			ig:ig_intelligentsia = {
            is_in_government = yes
				}
			ig:ig_landowners = {
            is_in_government = no
				}
			}
		}	
	}

	effect = {
	custom_tooltip = historical_tt
	custom_tooltip = reform_persia_advance
	custom_tooltip = darolfonoon_taken_tt
	trigger_event = { id = 03_persia_events.9 popup = yes }	
		
		set_variable = {
		name = darolfonoon_started_var
		value = yes		
			}	
	}
	ai_chance = {
		base = 100
		}
}

iran_button = {
	name = "iran_button"
	desc = "iran_button_desc"

		visible = {	
		has_variable = persia_name_var
		}		

	effect = {
	custom_tooltip = historical_tt
	remove_variable = persia_name_var
	
	add_loyalists = {
			value = 0.02
			}	
		}
		
		ai_chance = {
		base = 100
		}
		
}

zoroaster_button = {
	name = "zoroaster_button"
	desc = "zoroaster_button_desc"

	visible = {
		owner = {
		country_has_state_religion = rel:shiite
		}
		
	}

	possible = {
		OR = {
		has_law = law_type:law_freedom_of_conscience
				ig:ig_devout = {
			is_marginal = yes
			}
		}
	}

	effect = {
		custom_tooltip = je_shahenshah_advance
			change_variable = {
			name = empire_reborn_var
			add = 1
		}
		set_state_religion = rel:zoroastrian
		ig:ig_devout = {
			#	add_modifier = {
			#	name = love_magi_modifier
			#	}
			hidden_effect = { set_interest_group_name = Magi }
			remove_ideology = ideology_moralist
			add_ideology = ideology_zoroastrian_moralist
			remove_ig_trait = ig_trait:ig_trait_sharia
			set_ig_trait = ig_trait:ig_trait_protectors_of_nature
			remove_ig_trait = ig_trait:ig_trait_fatwa
			set_ig_trait = ig_trait:ig_trait_good_thought_word_deed
				}
		
		trigger_event = { id = 01_persia_events.3 popup = yes }
		create_character = {
					first_name = Maneckji_Limji
					last_name = Hataria
					historical = yes
					interest_group = ig_devout
					ig_leader = yes
					birth_date = 1813.1.2
					culture = cu:persian
					religion = rel:zoroastrian
					ideology = ideology_zoroastrian_moralist					
					traits = {
						persistent												
						pious						
						inspirational_orator
				}
				on_created = {
				set_variable = {
					name = is_hataria_var					
				}				
			}
				
		}
		custom_tooltip = {
					text = move_zoroastrians_tt

			s:STATE_GUJARAT = {				
					every_scope_state = {
						every_scope_pop = {
							limit = {
								#culture = cu:persian
								religion = rel:zoroastrian
							}
							move_pop = root.capital
						}
					}
				}

			s:STATE_NAGPUR = {				
					every_scope_state = {
						every_scope_pop = {
							limit = {
								#culture = cu:persian
								religion = rel:zoroastrian
							}
							move_pop = root.capital
						}
					}
				}
		
			s:STATE_SINDH = {								
					every_scope_state = {
						every_scope_pop = {
							limit = {
								#culture = cu:persian
								religion = rel:zoroastrian
							}
							move_pop = root.capital
						}
					}
				}
		
			s:STATE_BOMBAY = {				
					every_scope_state = {
						every_scope_pop = {
							limit = {
								#culture = cu:persian
								religion = rel:zoroastrian
							}
							move_pop = root.capital
						}
					}
				}
		
			s:STATE_BALUCHISTAN = {				
					every_scope_state = {
						every_scope_pop = {
							limit = {
								#culture = cu:persian
								religion = rel:zoroastrian
							}
							move_pop = root.capital
						}
					}
				}

			s:STATE_SISTAN = {				
					every_scope_state = {
						every_scope_pop = {
							limit = {
								#culture = cu:persian
								religion = rel:zoroastrian
							}
							move_pop = root.capital
						}
					}
				}
		
			s:STATE_BOMBAY = {				
					every_scope_state = {
						every_scope_pop = {
							limit = {
								#culture = cu:persian
								religion = rel:zoroastrian
							}
							move_pop = root.capital
						}
					}
				}
		}
		set_variable = {
		name = zoroaster_var
		value = yes		
			}
								change_variable = {
			name = shahenshah_var
			add = 1
			}
	}
	ai_chance = {
		base = 10
	}
}

persepolis_button = {
	name = "persepolis_button"
	desc = "persepolis_button_desc"

	visible = {
	
		owner = { 
		NOT = {
			has_technology_researched = great_library_of_persia	
			}
		}
	}

	possible = {
		any_scope_state = {
					state_region = s:STATE_FARS
					is_capital = yes
			any_scope_building = {
				is_building_type = building_persepolis
				level = 01
					}
		}
	}

	effect = {
		custom_tooltip = je_shahenshah_advance
		trigger_event = { id = 01_persia_events.1 popup = yes }
							change_variable = {
			name = shahenshah_var
			add = 1
		}
		add_technology_researched = great_library_of_persia
	}
}

form_satrapies_button = {
	name = "form_satrapies_button"
	desc = "form_satrapies_button_desc"

	visible = {
		owner = { 
			NOT = { has_variable = form_satrapies_var } 
		}
	}

	possible = {
	any_subject_or_below = {
			is_subject_of = ROOT
				count >= 4
			}
	}

	effect = {
	set_variable = form_satrapies_var
	custom_tooltip = je_shahenshah_advance
	add_modifier = {
	name = satraps_modifier
	}
		trigger_event = { id = 01_persia_events.14 popup = yes }
					change_variable = {
			name = shahenshah_var
			add = 1
		}	
	}
	ai_chance = {
		base = 10
	}
}

reclaim_armenia_button = {
	name = "reclaim_armenia_button"
	desc = "reclaim_armenia_button_desc"

	visible = {	
			NOT = { exists = c:ARM } 			
	}
	possible = {
	calc_true_if = {
			amount >= 3
		owns_entire_state_region = STATE_ARMENIA
		owns_entire_state_region = STATE_ERZURUM
		owns_entire_state_region = STATE_KARS
		}	
	}

	effect = {
	trigger_event = { id = 01_persia_events.6 }		
		create_country = {
    tag = ARM
    origin = c:PER
    state = s:STATE_ARMENIA.region_state:PER
	state = s:STATE_ERZURUM.region_state:PER
	state = s:STATE_KARS.region_state:PER
		}
			create_diplomatic_pact = {
            country = c:ARM
            type = vassal
        }
		add_modifier = {
		name = armenian_advisors_modifier }
				c:ARM = {
			add_modifier = {
				name = persian_advisors_modifier
			}
			add_modifier = {
		name = armenian_advisors_modifier }
		}

	}
	ai_chance = {
		base = 10
	}
}

reinstate_israel_button = {
	name = "reinstate_israel_button"
	desc = "reinstate_israel_button_desc"

	visible = {	
			NOT = { exists = c:ISR } 			
	}
	possible = {
	owns_entire_state_region = STATE_PALESTINE	
	}

	effect = {
		trigger_event = { id = 01_persia_events.9 }
		create_country = {
    tag = ISR
    origin = c:PER
    state = s:STATE_PALESTINE.region_state:PER
		}
			create_diplomatic_pact = {
            country = c:ISR
            type = vassal
        }
		
				add_modifier = {
		name = jewish_advisors_modifier }
		
				c:ISR = {
			add_modifier = {
				name = persian_advisors_modifier
				}			
			}	
				
	}
	ai_chance = {
		base = 10
	}
}

reclaim_phoenicia_button = {
	name = "reclaim_phoenicia_button"
	desc = "reclaim_phoenicia_button_desc"

	visible = {	
			NOT = { exists = c:PHO } 			
	}
	possible = {
	owns_entire_state_region = STATE_LEBANON
	owns_entire_state_region = STATE_ALEPPO
	}

	effect = {
	trigger_event = { id = 01_persia_events.12 }
	create_country = {
    tag = PHO
    origin = c:PER
    state = s:STATE_LEBANON.region_state:PER
	state = s:STATE_ALEPPO.region_state:PER
		}
			create_diplomatic_pact = {
            country = c:PHO
            type = vassal
        }
		add_modifier = {
		name = phoenician_ship_builders_modifier }
				c:PHO = {
			add_modifier = {
				name = persian_advisors_modifier
			}
			add_modifier = {
		name = phoenician_ship_builders_modifier }
		}	
	}
	ai_chance = {
		base = 10
	}
}

reclaim_lydia_button = {
	name = "reclaim_lydia_button"
	desc = "reclaim_lydia_button_desc"

	visible = {	
			NOT = { exists = c:LYD } 			
	}
	possible = {
		owns_entire_state_region = STATE_AYDIN
		owns_entire_state_region = STATE_KONYA
		owns_entire_state_region = STATE_HUDAVENDIGAR
		owns_entire_state_region = STATE_KASTAMONU
		owns_entire_state_region = STATE_ANKARA
	}

	effect = {
	trigger_event = { id = 01_persia_events.13 }
		create_country = {
    tag = LYD
    origin = c:PER
    state = s:STATE_AYDIN.region_state:PER
	state = s:STATE_KONYA.region_state:PER
    state = s:STATE_HUDAVENDIGAR.region_state:PER
	state = s:STATE_KASTAMONU.region_state:PER
    state = s:STATE_ANKARA.region_state:PER
		}
			create_diplomatic_pact = {
            country = c:LYD
            type = vassal
        }
		add_modifier = {
		name = lydian_advisors_modifier }
				c:LYD = {
			add_modifier = {
				name = persian_advisors_modifier
			}
			add_modifier = {
		name = lydian_advisors_modifier }
		}	
	}
	ai_chance = {
		base = 10
	}
}

reclaim_babylon_button = {
	name = "reclaim_babylon_button"
	desc = "reclaim_babylon_button_desc"

	visible = {	
			NOT = { exists = c:BAB } 			
	}
	possible = {
		owns_entire_state_region = STATE_BAGHDAD
		owns_entire_state_region = STATE_BASRA
	}

	effect = {
	trigger_event = { id = 01_persia_events.7 }
				create_country = {
    tag = BAB
    origin = c:PER
    state = s:STATE_BAGHDAD.region_state:PER
	state = s:STATE_BASRA.region_state:PER
		}
			create_diplomatic_pact = {
            country = c:BAB
            type = vassal
        }
		add_modifier = {
		name = babylonian_advisors_modifier }
				c:BAB = {
			add_modifier = {
				name = persian_advisors_modifier
			}
			add_modifier = {
		name = babylonian_advisors_modifier }
		}	
	}
	ai_chance = {
		base = 10
	}
}

reclaim_assyria_button = {
	name = "reclaim_assyria_button"
	desc = "reclaim_assyria_button_desc"

	visible = {	
			NOT = { exists = c:ASS } 			
	}
	possible = {
		owns_entire_state_region = STATE_MOSUL
		owns_entire_state_region = STATE_DEIR_EZ_ZOR
	}

	effect = {
	trigger_event = { id = 01_persia_events.8 }
	create_country = {
    tag = ASS
    origin = c:PER
    state = s:STATE_MOSUL.region_state:PER
	state = s:STATE_DEIR_EZ_ZOR.region_state:PER
		}
			create_diplomatic_pact = {
            country = c:ASS
            type = vassal
        }
		add_modifier = {
		name = assyrian_advisors_modifier }
				c:ASS = {
			add_modifier = {
				name = persian_advisors_modifier
			}
			add_modifier = {
		name = assyrian_advisors_modifier }
		}	
	}
	ai_chance = {
		base = 10
	}
}

british_loans_button = {
	name = "british_loans_button"
	desc = "british_loans_button_desc"

	visible = {			
		OR = {
		this = c:PER
		this = c:QAJ
		}
		owner = {
		#has_journal_entry = je_persia_great_game
		NOT = {
			has_modifier = british_repayment_modifier
			}
		}			
	}
	possible = {
		credit > 0
		NOT = {
		gold_reserves > 0
			}
			c:GBR = {
			relations:root >= relations_threshold:amicable
			}
		}
	
	effect = {
	custom_tooltip = historical_tt				
			trigger_event = { id = 03_persia_events.19 popup = yes }	
	}
	ai_chance = {
		base = 10
	}
}

russian_loans_button = {
	name = "russian_loans_button"
	desc = "russian_loans_button_desc"

	visible = {			
		OR = {
		this = c:PER
		this = c:QAJ
		}
		owner = {
		#has_journal_entry = je_persia_great_game
		NOT = {
			has_modifier = russian_repayment_modifier
			}
		}			
	}
	possible = {
		credit > 0
		NOT = {
		gold_reserves > 0
			}
		c:RUS = {
			relations:root >= relations_threshold:amicable
			}
		}
	
	effect = {
	trigger_event = { id = 03_persia_events.20 popup = yes }	
	}
	ai_chance = {
		base = 10
	}
}

end_british_loans_button = {
	name = "end_british_loans_button"
	desc = "end_british_loans_button_desc"

	visible = {			
		OR = {
		this = c:PER
		this = c:QAJ
		}
		owner = {
		has_modifier = british_repayment_modifier
		}			
	}
	possible = {
		
		}
	
	effect = {			
				remove_modifier = british_repayment_modifier
				c:GBR = {
				remove_modifier = for_british_repayment_modifier
				}
				change_infamy = 25
				change_relations = { 
				country = c:GBR 
				value = -50 
			}
	}
	ai_chance = {
		base = 0
	}
}

end_russian_loans_button = {
	name = "end_russian_loans_button"
	desc = "end_russian_loans_button_desc"

	visible = {			
		OR = {
		this = c:PER
		this = c:QAJ
		}
		owner = {
		has_modifier = russian_repayment_modifier
		}			
	}
	possible = {
		
		}
	
	effect = {
				remove_modifier = russian_repayment_modifier
				c:RUS = {
				remove_modifier = for_russian_repayment_modifier
				}
				change_infamy = 25
				change_relations = { 
				country = c:RUS 
				value = -50 
				}
	}
	ai_chance = {
		base = 0
	}
}

laristan_payment_button = {
	name = "laristan_payment_button"
	desc = "laristan_payment_button_desc"

	visible = {			
		exists = c:PER
		this = c:PER
		NOT = {
				owns_entire_state_region = STATE_LARISTAN
				has_variable = laristan_payment_var
			}
		has_variable = show_stand_free_stand_together_var			
	}
	possible = {
		c:OMA = {
			relations:root >= relations_threshold:amicable
			is_at_war = no
			}
		}
	
	effect = {
	add_journal_entry = {
        	type = je_laristan_payment
        }	
		set_variable = {
			name = oman_payment_cost_var
			value = money_amount_multiplier_large
		}
		add_modifier = {
			name = persia_laristan_payment_modifier
			multiplier = money_amount_multiplier_medium
			years = 1
		}
				
			c:OMA = {
			add_modifier = {
				name = oman_laristan_payment_modifier
				multiplier = money_amount_multiplier_medium_persia
				years = 1
			}	
		}
		set_variable = {
			name = oman_payment_var
			value = 0
		}		
		set_variable = {
		name = laristan_payment_var
		value = yes		
			}	
	}
	ai_chance = {
		base = 10
	}
}


ally_with_khiva_button = {
	name = "ally_with_khiva_button"
	desc = "ally_with_khiva_button_desc"

	visible = {			
		OR = {
		this = c:PER
		this = c:QAJ
		}
		c:KHI = {
			NOT = {
				has_modifier = the_crescent_modifier
			}			
		}
	}
	possible = {
		custom_tooltip = {
			text = the_crescent_formed_tt
			has_technology_researched = academia
			has_technology_researched = mass_communication
			has_variable = crescent_confirmed_var
			}				
			ROOT = {
			is_in_same_power_bloc = c:KHI
		}
	}
	
	effect = {
	trigger_event = { id = 02_persia_events.18 popup = yes }		
			
	
		c:KHI = {
			add_modifier = {
				name = the_crescent_modifier
			}	
		}
	}
	ai_chance = {
		base = 10
	}
}

unite_afghanistan_button = {
	name = "unite_afghanistan_button"
	desc = "unite_afghanistan_button_desc"

	visible = {			
		OR = {
		NOT = {
		exists = c:AFG
			}
		c:AFG = {
			NOT = {
				has_modifier = the_crescent_modifier
				}
			}			
		}			
	}
	possible = {
		custom_tooltip = {
			text = the_crescent_formed_tt
			has_technology_researched = academia
			has_technology_researched = mass_communication
			has_variable = crescent_confirmed_var
			}
			custom_tooltip = {
			text = persia_form_afghanistan_tt
			exists = c:AFG
				ROOT = {
			is_in_same_power_bloc = c:AFG
			}
		}
	}
	
	effect = {
	trigger_event = { id = 02_persia_events.19 popup = yes }
	
			c:AFG = {
			add_modifier = {
				name = the_crescent_modifier
			}

		}	
	}
	ai_chance = {
		base = 10
	}
}

unite_baluchistan_button = {
	name = "unite_baluchistan_button"
	desc = "unite_baluchistan_button_desc"

	visible = {			
		OR = {
		NOT = {
		exists = c:BLH
			}
		c:BLH = {
			NOT = {
				has_modifier = the_crescent_modifier
				}
			}			
		}			
	}
	possible = {
		custom_tooltip = {
			text = the_crescent_formed_tt
			has_technology_researched = academia
			has_technology_researched = mass_communication
			has_variable = crescent_confirmed_var
			}
				ROOT = {
			is_in_same_power_bloc = c:KAL
			is_in_same_power_bloc = c:MAK
		}

	}
	
	effect = {
	trigger_event = { id = 02_persia_events.20 popup = yes }			
		
	c:KAL = {
			annex = c:MAK
			
			add_modifier = {
				name = the_crescent_modifier
			}

			change_tag = BLH
		}
	
	}
	ai_chance = {
		base = 10
	}
}

unite_transcaucasia_button = {
	name = "unite_transcaucasia_button"
	desc = "unite_transcaucasia_button_desc"

	visible = {			
		OR = {
		NOT = {
		exists = c:CAU
			}
		c:CAU = {
			NOT = {
				has_modifier = the_crescent_modifier
				}
			}			
		}			
	}
	possible = {
		custom_tooltip = {
			text = persia_form_transcaucasia_tt
		
				c:ARM = {
				#custom_tooltip = {
			#text = armenia_at_peace_tt
		is_at_war = no
					NOT = {
		any_diplomatic_play = {
			any_scope_play_involved = { this = c:ARM }
				}
			}
		#}
	}
							ROOT = {
				is_in_same_power_bloc = c:ARM
			}
		c:GEO = {
				#custom_tooltip = {
			#text = georgia_at_peace_tt
		is_at_war = no
					NOT = {
		any_diplomatic_play = {
			any_scope_play_involved = { this = c:GEO }
				}
			}
		#}
	}
							ROOT = {
				is_in_same_power_bloc = c:GEO
			}
		c:AZB = {
				#custom_tooltip = {
			#text = azerbaijan_at_peace_tt
		is_at_war = no
					NOT = {
		any_diplomatic_play = {
			any_scope_play_involved = { this = c:AZB }
				}
			}
		#}
	}

							ROOT = {
				is_in_same_power_bloc = c:AZB
			}
		}
	}
	
	effect = {
	trigger_event = { id = 02_persia_events.21 popup = yes }			
		
	create_country = {
    tag = CAU
    origin = c:PER
    state = s:STATE_ARMENIA.region_state:ARM
	state = s:STATE_KARS.region_state:ARM
	state = s:STATE_GREATER_CAUCASUS.region_state:GEO
	state = s:STATE_AZERBAIJAN.region_state:AZB
		}
	
	c:CAU = {
			add_modifier = {
				name = the_crescent_modifier
			}	
		}
		hidden_effect = {
		change_relations = { 
				country = c:CAU 
				value = 50 
			}
		}
			
	}
	ai_chance = {
		base = 10
	}
}

ottoman_unrest_button = {
	name = "ottoman_unrest_button"
	desc = "ottoman_unrest_button_desc"

	visible = {
	exists = c:TUR		
		NOT = {
		exists = c:ARM
		exists = c:IRA
			}
	}

	possible = {
	NOT = {
				has_modifier = promote_ottoman_nationalism_modifier
			}	
		produced_bureaucracy > 200
	has_interest_marker_in_region = region_arabic
	has_interest_marker_in_region = region_anatolia
	}

	effect = {
		add_journal_entry = {
        	type = je_ottoman_unrest
        }
	exists = c:TUR
	c:TUR = {

		add_modifier = {
			name = cultural_unrest_modifier
			months = 12
			}

		}
			c:PER = {
					add_modifier = {
			name = promote_ottoman_nationalism_modifier
			months = 12
			}

		}
			set_variable = {
			name = ottoman_unrest_var
			value = 0
		}
	}
	ai_chance = {
		base = 10
	}
}

russia_unrest_button = {
	name = "russia_unrest_button"
	desc = "russia_unrest_button_desc"

	visible = {
	exists = c:RUS		
		NOT = {
		exists = c:ARM
		exists = c:GEO
		exists = c:AZB
			}
	}

	possible = {
	NOT = {
				has_modifier = promote_russia_nationalism_modifier
			}	
		produced_bureaucracy > 200
	has_interest_marker_in_region = region_caucasus
	}

	effect = {
		add_journal_entry = {
        	type = je_russian_unrest
        }
	c:RUS = {

		add_modifier = {
			name = cultural_unrest_modifier
			months = 12
			}

		}
			c:PER = {
					add_modifier = {
			name = promote_russia_nationalism_modifier
			months = 12
			}

		}
			
	}
	ai_chance = {
		base = 10
	}
}

egypt_unrest_button = {
	name = "egypt_unrest_button"
	desc = "egypt_unrest_button_desc"

	visible = {
	exists = c:EGY		
		NOT = {
		exists = c:SYR
			}
	}

	possible = {
	NOT = {
				has_modifier = promote_egypt_nationalism_modifier
			}	
		produced_bureaucracy > 200
	has_interest_marker_in_region = region_arabic
	}

	effect = {
		add_journal_entry = {
        	type = je_egyptian_unrest
        }

	c:EGY = {

		add_modifier = {
			name = cultural_unrest_modifier
			months = 12
			}

		}
			c:PER = {
					add_modifier = {
			name = promote_egypt_nationalism_modifier
			months = 12
			}

		}
	}
	ai_chance = {
		base = 10
	}
}

council_of_tehran_button = {
	name = "council_of_tehran_button"
	desc = "council_of_tehran_button_desc"

	visible = {			
		NOT = {				
				has_variable = council_of_tehran_var
			}
	has_variable = name_the_crescent_var
	}
	possible = {
		produced_bureaucracy > 500					
				OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic

				}
			custom_tooltip = {
			text = council_of_tehran_possible_tt
			has_variable = free_the_crescent_var
			}
		}
	
	effect = {
	add_modifier = {
			name = build_democratic_institutions_modifier
			months = 24
			}
			
				set_variable = {
			name = build_democratic_institutions_var
			value = 0
		}	
	
	trigger_event = { id = 02_persia_events.9 popup = yes }
		
		set_variable = {
		name = council_of_tehran_var
		value = yes		
			}	
	}
	ai_chance = {
		base = 100
	}
}

total_recognition_button = {
	name = "total_recognition_button"
	desc = "total_recognition_button_desc"

	visible = {			
		NOT = {
				has_variable = stand_free_stand_together_complete_var
			}
			has_variable = soothe_the_beasts_var
	}
	possible = {
		is_country_type = recognized
		country_rank = rank_value:great_power
		}
	
	effect = {
	custom_tooltip = je_stand_free_stand_together_advance
							change_variable = {
			name = stand_free_stand_together_var
			add = 1
			}
	trigger_event = { id = 02_persia_events.11 popup = yes }
	c:BLH = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
			}
		}		
	c:AFG = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
			}
		}	
	c:KHI = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
			}
		}
	c:IRQ = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
			}
		}
	c:SYR = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
			}
		}
	c:CAU = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
			}
		}	
	c:TUR = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
		}
	}
	c:EGY = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
		}
	}
 	c:ARA = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
		}
	}
	c:KUR = {	
		if = {			
			limit = {
					is_country_type = unrecognized
								OR = {
			has_law = law_type:law_presidential_republic
			has_law = law_type:law_parliamentary_republic
				}
			}			
				set_country_type = recognized				
		}
	}
	
		
		#set_variable = {
		#name = total_recognition_var
		#value = yes		
		#	}
	
	}
	ai_chance = {
		base = 100
	}
}












in_a_pickle_landowners_button = {
	name = "in_a_pickle_landowners_button"
	desc = "in_a_pickle_landowners_button_desc"

	visible = {
		owner = { has_variable = chose_initial_dil_brother
		any_interest_group = {
			leader = {
				has_variable = rahim_dil_alive_var
				}
			}
		}
		
	}

	possible = {
		ig:ig_landowners = {
			is_in_government = yes
			custom_tooltip = {
			text = rahim_dil_alive_tt
			leader = {
				has_variable = rahim_dil_alive_var
				}
			}
		}
		custom_tooltip = {
			text = not_already_supporting_land_owners
			NOT = { has_variable = supporting_land_owners_var }
		}
	}

	effect = {
		set_variable = supporting_land_owners_var
		remove_variable = supporting_armed_forces_var
		remove_variable = supporting_bourgeoisie_brotherly_var
		remove_variable = supporting_rural_folk_var
		custom_tooltip = {
			text = changed_in_a_pickle_support
			change_variable = { # reset the clock!
				name = in_a_pickle_progress_var
				multiply = 0
			}
		}
		custom_tooltip = {
			text = supporting_rahim_tt
		}
	}
}

in_a_pickle_armed_forces_button = {
	name = "in_a_pickle_armed_forces_button"
	desc = "in_a_pickle_armed_forces_button_desc"

	visible = {
		owner = { has_variable = chose_initial_dil_brother
		any_interest_group = {
			leader = {
				has_variable = mir_dil_alive_var
				}
			}
		}
	}

	possible = {
		ig:ig_armed_forces = {
			is_in_government = yes
			custom_tooltip = {
			text = mir_dil_alive_tt
			leader = {
				has_variable = mir_dil_alive_var
				}
			}
		}
		custom_tooltip = {
			text = not_already_supporting_armed_forces
			NOT = { has_variable = supporting_armed_forces_var }
		}
	}

	effect = {
		set_variable = supporting_armed_forces_var
		remove_variable = supporting_land_owners_var
		remove_variable = supporting_bourgeoisie_brotherly_var
		remove_variable = supporting_rural_folk_var
		custom_tooltip = {
			text = changed_in_a_pickle_support
			change_variable = { # reset the clock!
				name = in_a_pickle_progress_var
				multiply = 0
			}
		}
		custom_tooltip = {
			text = supporting_mir_tt
		}
	}
}

indian_equality_button = {
	name = "indian_equality_button"
	desc = "indian_equality_button_desc"

	visible = {
	NOT = {
	country_has_primary_culture = cu:bengali	
		}
	}

	possible = {
		OR = {
		has_law = law_type:law_cultural_exclusion
		has_law = law_type:law_multicultural
		}
	}

	effect = {
			if = {
				limit = {
				has_modifier = sepoy_modifier
				}
				remove_modifier = sepoy_modifier
				}
				
			set_variable = doctrine_of_lapse_ended
			custom_tooltip = uf_doctrine_of_lapse_disabled_tt
			
			add_primary_culture = cu:bengali
			add_primary_culture = cu:assamese
			add_primary_culture = cu:avadhi
			add_primary_culture = cu:bihari
			add_primary_culture = cu:gujarati
			add_primary_culture = cu:kanauji
			add_primary_culture = cu:kannada
			add_primary_culture = cu:malayalam
			add_primary_culture = cu:marathi
			add_primary_culture = cu:oriya
			add_primary_culture = cu:panjabi
			add_primary_culture = cu:rajput
			add_primary_culture = cu:sindi
			add_primary_culture = cu:tamil
			add_primary_culture = cu:telegu
	}
}

push_for_independance_button = {
	name = "push_for_independance_button"
	desc = "push_for_independance_button_desc"

	visible = {
	
	}

	possible = {
		c:GBR = {
			relations:root <= relations_threshold:neutral
			}
		is_at_war = no
	custom_tooltip = {
			text = uf_bic_independance_tt
				NOT = {
					any_diplomatic_play = {
						any_scope_play_involved = { this = c:GBR }
						any_scope_play_involved = { this = c:BIC }
					}
				}
			}
	}

	effect = {
			add_modifier = {
			name = independance_fervor_modifier
			years = 2
			}
		create_diplomatic_play = {
			name = bic_independance
			target_country = c:GBR	
			type = dp_independence
			}
	}
}

indian_union_button = {
	name = "indian_union_button"
	desc = "indian_union_button_desc"

	visible = {
	has_technology_researched = nationalism	
	}

	possible = {
		
		country_rank >= rank_value:unrecognized_regional_power		
		has_technology_researched = pan-nationalism
		is_subject = no
	}
	
	effect = {
		custom_tooltip = indian_union_tt
		if = {
			limit = {
				c:AWA = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:AWA
				type = tributary
			}		
		}
		if = {
			limit = {
				c:AWA = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root
				is_adjacent_to_country = root
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:AWA
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:BAS = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:BAS
				type = tributary
			}		
		}
		if = {
			limit = {
				c:BAS = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:BAS
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:BER = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:BER
				type = tributary
			}		
		}
		if = {
			limit = {
				c:BER = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:BER
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:BHO = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:BHO
				type = tributary
			}		
		}
		if = {
			limit = {
				c:BHO = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:BHO
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:BIK = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:BIK
				type = tributary
			}		
		}
		if = {
			limit = {
				c:BIK = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:BIK
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:BUN = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:BUN
				type = tributary
			}		
		}
		if = {
			limit = {
				c:BUN = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:BUN
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:GWA = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:GWA
				type = tributary
			}		
		}
		if = {
			limit = {
				c:HYD = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:HYD
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:JAI = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:JAI
				type = tributary
			}		
		}
		if = {
			limit = {
				c:JAI = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:JAI
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:IND = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:IND
				type = tributary
			}		
		}
		if = {
			limit = {
				c:IND = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:IND
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:JAS = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:JAS
				type = tributary
			}		
		}
		if = {
			limit = {
				c:JAS = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:JAS
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:JOD = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:JOD
				type = tributary
			}		
		}
		if = {
			limit = {
				c:JOD = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:JOD
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:KUT = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:KUT
				type = tributary
			}		
		}
		if = {
			limit = {
				c:KUT = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:KUT
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:MEW = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:MEW
				type = tributary
			}		
		}
		if = {
			limit = {
				c:MEW = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:MEW
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:MYS = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:MYS
				type = tributary
			}		
		}
		if = {
			limit = {
				c:MYS = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:MYS
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:NAG = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:NAG
				type = tributary
			}		
		}
		if = {
			limit = {
				c:NAG = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:NAG
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:NEP = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:NEP
				type = tributary
			}		
		}
		if = {
			limit = {
				c:NEP = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:NEP
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:ORI = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:ORI
				type = tributary
			}		
		}
		if = {
			limit = {
				c:ORI = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:ORI
				type = protectorate
			}		
		}
		if = {
			limit = {
				c:TRA = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				has_diplomatic_pact = {
					who = root
					type = customs_union
					}				
				}
			}
		create_diplomatic_pact = {
				country = c:TRA
				type = tributary
			}		
		}
		if = {
			limit = {
				c:TRA = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root	
				}
				is_country_type = recognized
			}
		create_diplomatic_pact = {
				country = c:TRA
				type = protectorate
			}		
		}
	}
	
	ai_chance = {
		base = 100
	}
}

bic_loans_button = {
	name = "bic_loans_button"
	desc = "bic_loans_button_desc"

	visible = {
		
	}

	possible = {
		credit > 0
		gold_reserves >= 10000000
	}
	
	effect = {
		add_treasury = -20000000
		c:GBR = {
		add_treasury = 20000000
		}
			remove_modifier = bic_bailout_modifier		
	}	
	ai_chance = {
		base = 0
	}
}

sell_koh_i_nor_button = {
	name = "sell_koh_i_nor_button"
	desc = "sell_koh_i_nor_button_desc"

	visible = {
	NOT = {
		this = c:GBR
		}
	}

	possible = {
		credit < 0
	}
	
	effect = {
		add_treasury = -5000000
		c:GBR = {
		add_treasury = 5000000
		add_journal_entry = je_koh_i_nor		
		}
		remove_journal_entry = je_koh_i_nor
				
	}
	ai_chance = {
		base = 0
	}
}

kingly_state_button = {
	name = "kingly_state_button"
	desc = "kingly_state_button_desc"

	visible = {
		
	}

	possible = {
		c:BIC = {
		relations:root >= relations_threshold:amicable
			}
		
		credit <= -1
		OR = {
		scope:journal_entry = {
			is_goal_complete = yes  
			}
		GDP >= 10000000
		}
	}
	
	effect = {
		c:BIC = {
		create_diplomatic_pact = {
            country = root
            type = dominion
			}
		}
	}
	ai_chance = {
		base = 10
	}
}

foster_indian_agitation_button = {
	name = "foster_indian_agitation_button"
	desc = "foster_indian_agitation_button_desc"

	visible = {
		
	}

	possible = {
		has_technology_researched = nationalism		
		gold_reserves >= 1000000
		c:BIC = {
			NOT = {
				has_modifier = india_cultural_unrest_modifier
				}
			}
	}
	
	effect = {
		add_treasury = -1000000
		c:BIC = {
		add_modifier = {
			name = india_cultural_unrest_modifier
			months = 12
				}
			}
		
	}
	
	ai_chance = {
		base = 10
	}
}

lead_the_charge_button = {
	name = "lead_the_charge_button"
	desc = "lead_the_charge_button_desc"

	visible = {
		NOT = {
		c:BIC = {
		has_journal_entry = je_sepoy_mutiny
			}
		c:GBR = {
		has_variable = british_raj_var
			}
		}
		
	}

	possible = {
		has_technology_researched = nationalism
		custom_tooltip = {
			text = avert_mutiny_tt
		c:BIC = {
		has_journal_entry = je_avert_sepoy_mutiny
			}
		}
		is_at_war = no
		is_subject = no
	}
	
	effect = {
		custom_tooltip = better_chances_punjab_tt
		custom_tooltip = lead_charge_states_tt
		c:BIC = {
		trigger_event = { id = raj.62 popup = yes }
		set_variable = punjab_attacking_var
			}
			
		
	}
	
	
	ai_chance = {
			base = 0		
			
			modifier = {
				trigger = {
					is_subject = no
				}
				add = 100
			}									
		}
}

ban_sati_button = {
	name = "ban_sati_button"
	desc = "ban_sati_button_desc"

	visible = {
		has_modifier = sati_modifier
	}

	possible = {
		has_technology_researched = human_rights		
	}
	
	effect = {
		remove_modifier = sati_modifier		
	}
	
	ai_chance = {
		base = 10
	}
}

cede_herat_button = {
	name = "cede_herat_button"
	desc = "cede_herat_button_desc"

	visible = {
	has_journal_entry = je_the_great_western_player
	owns_entire_state_region = STATE_HERAT
	}

	possible = {
		
	}

	effect = {
	s:STATE_HERAT = {
			random_scope_state = {			
					set_state_owner = c:PER
				}
			}
		ai_chance = {
		base = 0
		}
	}
}

cede_balkh_button = {
	name = "cede_balkh_button"
	desc = "cede_balkh_button_desc"

	visible = {
	has_journal_entry = je_the_great_northern_players
	owns_entire_state_region = STATE_BALKH
	}

	possible = {
		
	}

	effect = {
	s:STATE_BALKH = {
			random_scope_state = {			
					set_state_owner = c:BUK
				}
			}
		ai_chance = {
		base = 0
		}
	}
}

cede_pashtunistan_claim_button = {
	name = "cede_pashtunistan_claim_button"
	desc = "cede_pashtunistan_claim_button_desc"

	visible = {
	has_journal_entry = je_the_great_eastern_player
	has_claim = s:STATE_PASHTUNISTAN
	}

	possible = {
		
	}

	effect = {
	s:STATE_PASHTUNISTAN = {
					remove_claim = root
				}
	}
}

cede_kalat_claim_button = {
	name = "cede_kalat_claim_button"
	desc = "cede_kalat_claim_button_desc"

	visible = {
	has_journal_entry = je_the_great_southern_players
	has_claim = s:STATE_BALUCHISTAN
	}

	possible = {
		
	}

	effect = {
	s:STATE_BALUCHISTAN = {
					remove_claim = root
				}
	}
}

remove_persias_claim_button = {
	name = "remove_persias_claim_button"
	desc = "remove_persias_claim_button_desc"

	visible = {
	has_journal_entry = je_the_great_western_player
	c:PER = {
	has_claim = s:STATE_HERAT
		}
	}

	possible = {
	owns_entire_state_region = STATE_HERAT
	OR = {
	is_owed_obligation_by = c:PER
	c:PER = {
	relations:root >= relations_threshold:friendly
			}
		}	
	}

	effect = {
	c:PER = {
				set_owes_obligation_to = {
					country = ROOT
					setting = no
				}
			}
		s:STATE_HERAT = {
					remove_claim = c:PER
				}
	}
}

remove_bukharas_claim_button = {
	name = "remove_bukharas_claim_button"
	desc = "remove_bukharas_claim_button_desc"

	visible = {
	has_journal_entry = je_the_great_northern_players
	c:BUK = {
	has_claim = s:STATE_BALKH
		}
	}

	possible = {
	owns_entire_state_region = STATE_BALKH
	OR = {
	is_owed_obligation_by = c:BUK
	c:BUK = {
	relations:root >= relations_threshold:friendly
			}
		}	
	}

	effect = {
	c:BUK = {
				set_owes_obligation_to = {
					country = ROOT
					setting = no
				}
			}
		s:STATE_BALKH = {
					remove_claim = c:BUK
				}
	}
}

guerrilla_war_button = {
	name = "guerrilla_war_button"
	desc = "guerrilla_war_button_desc"

	visible = {
	NOT = {
		has_variable = guerrilla_war_var
		}
	exists = c:DUR
	}

	possible = {
		
	}

	effect = {
	add_modifier = cost_guerrilla_war_modifier
	c:DUR = {
			add_modifier = {
			name = afghan_guerrilla_war_modifier
			years = 5
				}
			}
	set_variable = guerrilla_war_var
	}
	ai_chance = {
		base = 100
		}
}

encourage_revolt_button = {
	name = "encourage_revolt_button"
	desc = "encourage_revolt_button_desc"

	visible = {
	NOT = {
		has_variable = encourage_revolt_var
		}
	exists = c:DUR
	}

	possible = {	
	}

	effect = {
	add_modifier = {
	name = cost_encourage_revolt_modifier
	}
	c:DUR = {
			add_radicals = {
			value = 0.02
				}
			add_modifier = encourage_revolt_modifier
			}
	set_variable = encourage_revolt_var
	}
	ai_chance = {
		base = 100
		}
}

peaceful_afghan_union_button = {
	name = "peaceful_afghan_union_button"
	desc = "peaceful_afghan_union_button_desc"

	visible = {
	
	}

	possible = {	
		has_technology_researched = nationalism	
		country_rank >= rank_value:unrecognized_regional_power		
		is_subject = no
	}
	
	effect = {
		custom_tooltip = afghan_union_tt
		if = {
			limit = {
				exists = c:KAB
				c:KAB = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root					
				}
			}
		annex = c:KAB		
		}
		if = {
			limit = {
				exists = c:MAI
				c:MAI = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root					
				}
			}
		annex = c:MAI		
		}
		if = {
			limit = {
				exists = c:KAN
				c:KAN = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root					
				}
			}
		annex = c:KAN		
		}
		if = {
			limit = {
				exists = c:HER
				c:HER = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root					
				}
			}
		annex = c:HER		
		}
		if = {
			limit = {
				exists = c:DUR
				c:DUR = {
				relations:root >= relations_threshold:amicable
				is_player = no
				is_subject = no
				is_adjacent_to_country = root					
				}
			}
		annex = c:DUR		
		}
	}