mnd_siam_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Leviathan"
	}
	potential = {
		OR = {
			tag = AYU
			tag = SIA
		}
		has_dlc = "Leviathan"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes

	mnd_siam_transfer_development = {
		icon = mission_mnd_khm_protect_the_cham
		required_missions = {  }
		provinces_to_highlight = {
		}
		trigger = {
			capital_scope = {
				development = 30
			}
			OR = {
				num_of_times_used_transfer_development = 2
				capital_scope = { num_of_times_improved = 5 }
			}
		}
		effect = {
			change_government_reform_progress = 50
		}
	}
	mnd_siam_mandala = {
		icon = mission_se_birdmen
		required_missions = { mnd_siam_transfer_development }
		provinces_to_highlight = {
			is_capital = yes
			owned_by = ROOT
			NOT = { development = 40 }
		}
		trigger = {
			capital_scope = {
				development = 40
			}
			vassal = 3
		}
		effect = {
			add_country_modifier = {
				name = siam_mandala_modifier
				duration = 7300
			}
			capital_scope = {
				add_prosperity = 100
			}
		}
	}
	mnd_siam_great_monument = {
		icon = mission_buddhist_monk_praying
		required_missions = { mnd_siam_mandala }
		provinces_to_highlight = {
		}
		trigger = {
			4831 = {
				has_great_project = {
					type = the_grand_palace
					tier = 3
				}
			}
			if = {
				limit = {
					any_province = {
						OR = {
							has_province_modifier = emerald_buddha
							has_province_modifier = emerald_buddha_alternate
						}
					}
				}
				any_owned_province = {
					custom_trigger_tooltip = {
						tooltip = emerald_buddha_mission_tt
						OR = {
							has_province_modifier = emerald_buddha
							has_province_modifier = emerald_buddha_alternate
						}
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = siam_monument_modifier
				duration = -1
			}
		}
	}
	mnd_siam_city_of_worlds_desire = {
		icon = mission_mnd_khm_restored_empire
		required_missions = { mnd_siam_great_monument }
		provinces_to_highlight = {
			has_discovered = ROOT
			OR = {
				AND = {
					is_capital = yes
					owned_by = ROOT
					NOT = { development = 50 }
				}
				any_province = {
					is_capital_of = root
					NOT = { higher_development_than = prev }
				}
			}
		}
		trigger = {
			capital_scope = {
				development = 50
				NOT = {
					any_province = {
						higher_development_than = PREV
					}
				}
			}
		}
		effect = {
			add_prestige = 50
			add_country_modifier = {
				name = siam_best_city_modifier
				duration = -1
			}
		}
	}
}

mnd_siam_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Leviathan"
	}
	potential = {
		OR = {
			tag = AYU
			tag = SIA
		}
		has_dlc = "Leviathan"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	mnd_siam_japan = {
		icon = mission_japanese_samurai
		position = 2
		required_missions = { mnd_siam_transfer_development }
		provinces_to_highlight = {
			region = japan_region
		}
		trigger = {
			OR = {
				any_owned_province = {
					region = japan_region
				}
				any_known_country = {
					culture_group = japanese_g
					has_opinion = {
						who = ROOT
						value = 150
					}
				}
			}
		}
		effect = {
			custom_tooltip = japanese_mercs_flag
			define_general = {
				shock = 5
				fire = 4
				manuever = 3
				siege = 2
				name = "Yamada Nagamasa"
			}
		}
	}
	
	mnd_siam_devaraja = {
		icon = mission_mnd_siam_subjugate_vietnam
		required_missions = { mnd_siam_mandala }
		provinces_to_highlight = {
		}
		position = 3
		trigger = {
			if = {
				limit = {
					government = monarchy
				}
				legitimacy = 90
			}
			if = {
				limit = {
					has_estate = estate_church
				}
				estate_loyalty = {
					estate = estate_church
					loyalty = 65
				}
			}
			stability = 3
		}
		effect = {
			set_estate_privilege = estate_church_brahmins_at_court
		}
	}
	mnd_siam_revolution = {
		icon = mission_mnd_siam_revolution
		required_missions = { mnd_siam_devaraja }
		provinces_to_highlight = {
		}
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = had_siamese_revolution_tt
					has_country_flag = had_siamese_revolution
				}
				AND = {
					is_year = 1650
					custom_trigger_tooltip = {
						tooltip = had_siamese_revolution_tt_2
						NOT = {
							any_country = {
								technology_group = western
								any_owned_province = {
									superregion = east_indies_superregion
								}
							}
						}
					}
				}
			}
		}
		effect = {
			add_adm_power = 200
		}
	}
	mnd_siam_absolutism = {
		icon = mission_kowtow
		required_missions = { mnd_siam_revolution }
		provinces_to_highlight = {
		}
		trigger = {
			total_development = 500
			if = {
				limit = {
					is_revolutionary = no
				}
				absolutism = 75
			}
			has_regency = no
			is_at_war = no
			OR = {
				tag = SIA
				NOT = { exists = SIA }
			}
			is_subject = no
		}
		effect = {
			if = {
				limit = {
					NOT = { tag = SIA }
					NOT = { exists = SIA }
				}
				change_tag = SIA
				on_change_tag_effect = yes
				if = {
					limit = { has_custom_ideas = no }
					country_event = { id = ideagroups.1 } #Swap Ideas
				}
			}
			set_country_flag = siam_royal_absolutism
			if = {
				limit = {
					NOT = {
						government_rank = 3
					}
				}
				set_government_rank = 3
			}
			if = {
				limit = {
					is_revolutionary = no
				}
				country_event = {
					id = flavor_lna.3
				}
			}
			hidden_effect = {
				complete_mission = mnd_siam_absolutism
			}
		}
	}
}

mnd_siam_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Leviathan"
	}
	potential = {
		OR = {
			tag = AYU
			tag = SIA
		}
		has_dlc = "Leviathan"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	mnd_siam_royal_duel = {
		icon = mission_mnd_siam_royal_duel
		required_missions = {  }
		provinces_to_highlight = {
		}
		trigger = {
			is_monarch_leader = yes
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				army_professionalism = 20
			}
			else = {
				army_tradition = 20
			}
			OR = {
				NOT = { exists = KHM }
				army_tradition = KHM
			}
		}
		effect = {
			if = {
				limit = {
					exists = KHM
					KHM = {
						is_free_or_tributary_trigger = yes
					}
				}
				add_casus_belli = {
					target = KHM
					type = cb_vassalize_mission
					months = 120
				}
			}
			else = {
				cambodia_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				mekong_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				angkor_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	mnd_siam_subjugate_khmer = {
		icon = mission_unite_home_region
		required_missions = { mnd_siam_royal_duel }
		provinces_to_highlight = {
			OR = {
				area = cambodia_area
				area = mekong_area
				area = angkor_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			if = {
				limit = {
					KHM = {
						is_subject_of = ROOT
					}
				}
				NOT = {
					KHM = {
						liberty_desire = 50
					}
				}
			}
			cambodia_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			mekong_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			angkor_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			if = {
				limit = {
					num_of_subjects = 1
				}
				every_subject_country = {
					add_liberty_desire = -20
				}
			}
			else = {
				add_prestige = 20
			}
		}
	}
	mnd_siam_divide_the_lao = {
		icon = mission_mnd_maj_prepare_eastern_campaigns
		required_missions = { mnd_siam_subjugate_khmer }
		provinces_to_highlight = {
		}
		trigger = {
			OR = {
				calc_true_if = {
					amount = 3
					all_known_country = {
						primary_culture = lao
					}
				}
				primary_culture = lao
				NOT = {
					any_province = {
						culture = lao
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					calc_true_if = {
						amount = 3
						all_known_country = {
							primary_culture = lao
						}
					}
				}
				every_country = {
					limit = {
						is_free_or_tributary_trigger = yes
						primary_culture = lao
					}
					reverse_add_casus_belli = {
						target = ROOT
						type = cb_vassalize_mission
						months = 120
					}
				}
			}
			else = {
				vientiane_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				champasak_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				north_laos_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	mnd_siam_subjugate_the_lao = {
		icon = mission_mnd_maj_subjugate_makassar
		required_missions = { mnd_siam_divide_the_lao }
		provinces_to_highlight = {
			OR = {
				area = north_laos_area
				area = champasak_area
				area = vientiane_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			if = {
				limit = {
					any_country = {
						is_subject_of = ROOT
						primary_culture = lao
					}
				}
				NOT = {
					any_subject_country = {
						primary_culture = lao
						liberty_desire = 50
					}
				}
			}
			calc_true_if = {
				amount = 12
				all_province = {
					OR = {
						area = north_laos_area
						area = champasak_area
						area = vientiane_area
					}
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		effect = {
			if = {
				limit = {
					any_country = {
						OR = {
							primary_culture = vietnamese
							primary_culture = vietnamese_new
						}
						capital_scope = {
							region = indo_china_region
						}
						is_free_or_tributary_trigger = yes
					}
				}
				every_country = {
					limit = {
						OR = {
							primary_culture = vietnamese
							primary_culture = vietnamese_new
						}
						capital_scope = {
							region = indo_china_region
						}
						is_free_or_tributary_trigger = yes
					}
					reverse_add_casus_belli = {
						target = ROOT
						type = cb_vassalize_mission
						months = 120
					}
				}
			}
			else = {
				vietnam_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				red_river_delta_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}		
			}
		}
	}
	mnd_siam_subjugate_vietnam = {
		icon = mission_mnd_dai_imperial_citadel
		required_missions = { mnd_siam_subjugate_the_lao }
		provinces_to_highlight = {
			OR = {
				area = vietnam_area
				area = red_river_delta_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			if = {
				limit = {
					any_country = {
						is_subject_of = ROOT
						OR = {
							primary_culture = vietnamese
							primary_culture = vietnamese_new
						}
					}
				}
				NOT = {
					any_subject_country = {
						OR = {
							primary_culture = vietnamese
							primary_culture = vietnamese_new
						}
						liberty_desire = 50
					}
				}
			}
			vietnam_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
			red_river_delta_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			south_china_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	mnd_siam_defy_china = {
		icon = mission_great_wall
		required_missions = { mnd_siam_subjugate_vietnam mnd_siam_conquer_burma }
		provinces_to_highlight = {
			superregion = china_superregion
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			calc_true_if = {
				amount = 20
				all_province = {
					superregion = china_superregion
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		effect = {
			china_superregion = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	mnd_siam_take_the_mandate = {
		icon = mission_scholar_officials
		required_missions = { mnd_siam_defy_china }
		provinces_to_highlight = {
			if = {
				limit = {
					any_country = {
						is_emperor_of_china = yes
						NOT = { tag = ROOT }
					}
				}
				owner = {
					is_emperor_of_china = yes
				}
			}
			else = {
				superregion = china_superregion
				NOT = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		trigger = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				OR = {
					NOT = {
						any_country = {
							is_emperor_of_china = yes
						}
					}
					is_emperor_of_china = yes
				}
			}
			calc_true_if = {
				amount = 50
				all_province = {
					superregion = china_superregion
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
					is_emperor_of_china = yes
				}
				add_country_modifier = {
					name = siam_mandate_modifier
					duration = -1
				}
			}
			else = {
				add_adm_power = 100
				add_dip_power = 100
				add_mil_power = 100
				add_prestige = 50
			}
		}
	}
}

mnd_siam_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Leviathan"
	}
	potential = {
		OR = {
			tag = AYU
			tag = SIA
		}
		has_dlc = "Leviathan"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	mnd_siam_inherit_sukhothai = {
		icon = mission_mnd_khm_avenge_angkor
		required_missions = {  }
		provinces_to_highlight = {
			area = sukhothai_area
			NOT = { owned_by = ROOT }
		}
		trigger = {
			sukhothai_area = {
				type = all
				owned_by = ROOT
			}
		}
		effect = {
			if = {
				limit = {
					exists = LNA
					LNA = {
						is_free_or_tributary_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					target = LNA
					months = 120
				}
			}
			else = {
				northern_thai_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	mnd_siam_subjugate_chiang_mai = {
		icon = mission_che_the_cave_country
		required_missions = { mnd_siam_inherit_sukhothai }
		provinces_to_highlight = {
			area = northern_thai_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			if = {
				limit = {
					LNA = {
						is_subject_of = ROOT
					}
				}
				NOT = {
					LNA = {
						liberty_desire = 50
					}
				}
			}
			northern_thai_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			if = {
				limit = {
					exists = PEG
					PEG = {
						is_free_or_tributary_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_vassalize_mission
					target = PEG
					months = 120
				}
			}
			else = {
				lower_burma_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	mnd_siam_protect_the_mon = {
		icon = mission_rice_field
		required_missions = { mnd_siam_subjugate_chiang_mai }
		provinces_to_highlight = {
			area = lower_burma_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			if = {
				limit = {
					PEG = {
						is_subject_of = ROOT
					}
				}
				NOT = {
					PEG = {
						liberty_desire = 50
					}
				}
			}
			if = {
				limit = {
					any_owned_province = {
						culture = mon
					}
				}
				accepted_culture = mon
			}
			lower_burma_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
				culture = mon
			}
		}
		effect = {
			add_country_modifier = {
				name = siam_accepted_mon
				duration = -1
			}
		}
	}
	mnd_siam_defeat_burma = {
		icon = mission_indian_soldier_elephant
		required_missions = { mnd_siam_protect_the_mon }
		provinces_to_highlight = {
			owner = {
				capital_scope = {
					region = burma_region
				}
				total_development = 50
				is_free_or_tributary_trigger = yes
			}
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = crush_burma_tt
				NOT = {
					any_country = {
						capital_scope = {
							region = burma_region
						}
						total_development = 50
						is_free_or_tributary_trigger = yes
					}
				}
			}
		}
		effect = {
			burma_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
	mnd_siam_conquer_burma = {
		icon = mission_mnd_dai_control_the_army
		required_missions = { mnd_siam_defeat_burma }
		provinces_to_highlight = {
			region = burma_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			calc_true_if = {
				amount = 20
				all_province = {
					region = burma_region
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		effect = {
			xinan_region = {
				limit = {
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
	}
}

mnd_siam_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Leviathan"
	}
	potential = {
		OR = {
			tag = AYU
			tag = SIA
		}
		has_dlc = "Leviathan"
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	mnd_siam_prepare = {
		icon = mission_junk_boat
		required_missions = {  }
		provinces_to_highlight = {
			owner = {
				tag = MLC
				navy_size = ROOT
			}
		}
		trigger = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
					MLC = {
						is_subject_of_type = tributary_state
						overlord = {
							tag = MNG
							ai = yes
						}
						ai = yes
					}
				}
				MNG = {
					OR = {
						has_opinion = {
							who = ROOT
							value = 100
						}
						NOT = {
							imperial_mandate = 50
						}
						is_emperor_of_china = no
					}
				}
			}
			navy_size = MLC
			num_of_galley = 15
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
					MLC = {
						is_subject_of_type = tributary_state
						overlord = {
							tag = MNG
							ai = yes
						}
						ai = yes
					}
				}
				MLC = {
					add_opinion = {
						who = MNG
						modifier = abandoned_mlc
					}
				}
			}
			if = {
				limit = {
					exists = MLC
					MLC = {
						NOT = {
							OR = {
								is_subject_of_type = vassal
								is_subject_of_type = march
							}
						}
					}
				}
				add_casus_belli = {
					target = MLC
					type = cb_vassalize_mission
					months = 120
				}
			}
			else = {
				malacca_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	
	mnd_siam_mlc = {
		icon = mission_invade_island
		required_missions = { mnd_siam_prepare }
		provinces_to_highlight = {
			area = malacca_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			if = {
				limit = {
					MLC = {
						is_subject_of = ROOT
					}
				}
				NOT = {
					MLC = {
						liberty_desire = 50
					}
				}
			}
			malacca_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		effect = {
			add_navy_tradition = 20
			every_province = {
				limit = {
					region = malaya_region
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
					province_has_center_of_trade_of_level = 1
				}
				add_permanent_claim = ROOT
			}
		}
	}
	mnd_siam_trade = {
		icon = mission_market_place_with_asian_traders
		required_missions = { mnd_siam_mlc }
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 1361
					NOT = { is_strongest_trade_power = ROOT }
				}
				AND = {
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
					province_has_center_of_trade_of_level = 1
					region = malaya_region
				}
			}
		}
		trigger = {
			trading_bonus = {
				trade_goods = spices
				value = yes
			}
			1361 = {
				is_strongest_trade_power = ROOT
			}
			calc_true_if = {
				amount = 4
				all_province = {
					country_or_non_sovereign_subject_holds = ROOT
					province_has_center_of_trade_of_level = 1
					region = malaya_region
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "siam_trade"
				duration = -1
			}
			every_province = {
				limit = {
					region = indonesia_region
					NOT = { is_core = ROOT }
					NOT = { is_permanent_claim = ROOT }
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
					province_has_center_of_trade_of_level = 1
				}
				add_permanent_claim = ROOT
			}			
		}
	}
}