pick_random_estate_if_present = {
	random_list = {
		1 = { 
			trigger = {
				has_estate = estate_brahmins
				NOT = { has_country_flag = estate_brahmins_$flag$ }
			}
			set_country_flag = estate_brahmins_$flag$
			[[estate_action]
			$estate_action$ = estate_brahmins
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_church
				NOT = { has_country_flag = estate_church_$flag$ }
			}
			set_country_flag = estate_church_$flag$
			[[estate_action]
			$estate_action$ = estate_church
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_maratha
				NOT = { has_country_flag = estate_maratha_$flag$ }
			}
			set_country_flag = estate_maratha_$flag$ 
			[[estate_action]
			$estate_action$ = estate_maratha
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_nobles
				NOT = { has_country_flag = estate_nobles_$flag$ }
			}
			set_country_flag = estate_nobles_$flag$
			[[estate_action]
			$estate_action$ = estate_nobles
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_burghers
				NOT = { has_country_flag = estate_burghers_$flag$ }
			}
			set_country_flag = estate_burghers_$flag$
			[[estate_action]
			$estate_action$ = estate_burghers
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_vaisyas
				NOT = { has_country_flag = estate_vaisyas_$flag$ }
			}
			set_country_flag = estate_vaisyas_$flag$
			[[estate_action]
			$estate_action$ = estate_vaisyas
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_cossacks
				NOT = { has_country_flag = estate_cossacks_$flag$ }
			}
			set_country_flag = estate_cossacks_$flag$
			[[estate_action]
			$estate_action$ = estate_cossacks
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_nomadic_tribes
				NOT = { has_country_flag = estate_nomadic_tribes_$flag$ }
			}
			set_country_flag = estate_nomadic_tribes_$flag$
			[[estate_action]
			$estate_action$ = estate_nomadic_tribes
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_dhimmi
				NOT = { has_country_flag = estate_dhimmi_$flag$ }
			}
			set_country_flag = estate_dhimmi_$flag$
			[[estate_action]
			$estate_action$ = estate_dhimmi
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_jains
				NOT = { has_country_flag = estate_jains_$flag$ }
			}
			set_country_flag = estate_jains_$flag$
			[[estate_action]
			$estate_action$ = estate_jains
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_rajput
				NOT = { has_country_flag = estate_rajput_$flag$ }
			}
			set_country_flag = estate_rajput_$flag$
			[[estate_action]
			$estate_action$ = estate_rajput
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_eunuchs
				NOT = { has_country_flag = estate_eunuchs_$flag$ }
			}
			set_country_flag = estate_eunuchs_$flag$
			[[estate_action]
			$estate_action$ = estate_eunuchs
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_qizilbash
				NOT = { has_country_flag = estate_qizilbash_$flag$ }
			}
			set_country_flag = estate_qizilbash_$flag$
			[[estate_action]
			$estate_action$ = estate_qizilbash
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_ghulams
				NOT = { has_country_flag = estate_ghulams_$flag$ }
			}
			set_country_flag = estate_ghulams_$flag$
			[[estate_action]
			$estate_action$ = estate_ghulams
			]
		}
		1 = { 
			trigger = {
				has_estate = estate_peasants
				NOT = { has_country_flag = estate_peasants_$flag$ }
			}
			set_country_flag = estate_peasants_$flag$
			[[estate_action]
			$estate_action$ = estate_peasants
			]
		}
		#EE estate
		1 = { 
			trigger = {
				has_estate = me_estate_cultural_minorities 
				NOT = { has_country_flag = me_estate_cultural_minorities_$flag$ }
			}
			set_country_flag = me_estate_cultural_minorities_$flag$
			[[estate_action]
			$estate_action$ = me_estate_cultural_minorities 
			]
		}
		1 = {
			trigger = {
				has_estate = estate_turkic_tribes
				NOT = { has_country_flag = estate_turkic_tribes_$flag$ }
			}
			set_country_flag = estate_turkic_tribes_$flag$
			[[estate_action]
			$estate_action$ = estate_turkic_tribes
			]
		}
		1 = {
			trigger = {
				has_estate = estate_berbers
				NOT = { has_country_flag = estate_berbers_$flag$ }
			}
			set_country_flag = estate_berbers_$flag$
			[[estate_action]
			$estate_action$ = estate_berbers
			]
		}
	}
}