decisions = {

	create_european_union_emperor_germany = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			has_landed_title = e_germany
			NOT = { has_landed_title = e_european_union }
			e_european_union = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERUE.1 }}
			e_european_union = {
				grant_title = PREV
				add_law = succ_democracy
				hidden_tooltip = { make_primary_title = yes }
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy
				}
			}
		}
		
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 2
				religion = imperialist
			}
		}
	}
	
	create_european_union_emperor_france = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			has_landed_title = e_france
			NOT = { has_landed_title = e_european_union }
			e_european_union = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERUE.1 }}
			e_european_union = {
				grant_title = PREV
				add_law = succ_democracy
				hidden_tooltip = { make_primary_title = yes }
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy
				}
			}
		}
		
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 2
				religion = imperialist
			}
		}
	}
	
	create_european_union_emperor_hre = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = e_hre
				has_landed_title = e_communist_roman_union
			}
			NOT = { has_landed_title = e_european_union }
			e_european_union = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERUE.1 }}
			e_european_union = {
				grant_title = PREV
				add_law = succ_democracy
				hidden_tooltip = { make_primary_title = yes }
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy
				}
			}
		}
		
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 2
				religion = imperialist
			}
		}
	}
	
	create_european_union_by_force = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			NOT = { has_landed_title = e_european_union }
			NOT = { has_landed_title = e_hre }
			NOT = { has_landed_title = e_germany }
			NOT = { has_landed_title = e_france }
			e_european_union = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			realm_size = 200
			OR = {
				has_landed_title = k_french_republic
				has_landed_title = k_belgium
				has_landed_title = k_netherlands
				has_landed_title = k_lotharingian_republic
				has_landed_title = k_federal_germany
			}	
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERUE.1 }}
			e_european_union = {
				grant_title = PREV
				add_law = succ_democracy
				hidden_tooltip = { make_primary_title = yes }
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy
				}
			}
		}
		
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 2
				religion = imperialist
			}
		}
	}
	
	create_european_union_by_common_act = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = k_french_republic
				has_landed_title = k_belgium
				has_landed_title = k_netherlands
				has_landed_title = k_lotharingian_republic
				has_landed_title = k_federal_germany
			}
			NOT = { has_landed_title = e_european_union }
			NOT = { has_landed_title = e_germany }
			NOT = { has_landed_title = e_france }
			e_european_union = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
			any_independent_ruler = {
				eligible_to_ue_trigger = yes
				any_realm_province = {
					any_neighbor_province = {
						owner = {
							top_liege = {
								character = FROM
							}
						}
					}
				}
				opinion = { 
					who = FROM 
					value = 30 
				}
			}
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERUE.5 }}
			e_european_union = {
				grant_title = FROM
				add_law = succ_democracy
				hidden_tooltip = { make_primary_title = yes }
			}
			set_government_type = democracy_government
			any_independent_ruler = {
				limit = {
					eligible_to_ue_trigger = yes
					any_realm_province = {
						any_neighbor_province = {
							owner = {
								top_liege = {
									character = FROM
								}
							}
						}
					}
					opinion = { 
						who = FROM
						value = 30 
					}
				}
				set_defacto_liege = FROM
			}
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy
				}
			}
		}
		
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 2
				religion = imperialist
			}
		}
	}
	
	create_byzantin_union = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = e_byzantium
			}
			NOT = { has_landed_title = e_byzantin_union }
			e_byzantin_union = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERUE.10 }}
			e_byzantin_union = {
				grant_title = PREV
				add_law = succ_democracy
				hidden_tooltip = { make_primary_title = yes }
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy
				}
			}
		}
		
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 2
				religion = imperialist
			}
		}
	}
	
	create_united_kingdom = {
		only_independent = yes
		only_playable = yes
		is_high_prio = yes
		
		potential = {
			OR = {
				religion = liberalist
				religion = neo_classical
				religion = interventionist
				religion = imperialist
			}
			is_playable = yes
			OR = {
				is_republic = yes
				is_feudal = yes
			}
			OR = {
				has_landed_title = e_britannia
			}
			NOT = { has_landed_title = e_union_jack }
			e_union_jack = {
				has_holder = no
			}
		}
		
		allow = {
			independent = yes
			is_ruler = yes
			prisoner = no
			is_incapable = no
			is_adult = yes
			war = no
		}
		
		effect = {
			hidden_effect = { character_event = { id = ORDERUE.12 }}
			e_union_jack = {
				grant_title = PREV
				add_law = succ_democracy
				hidden_tooltip = { make_primary_title = yes }
			}
			set_government_type = democracy_government
			any_vassal = {
				limit = {
					government = feudal_government
					religion_group = capitalist
				}
				set_government_type = democracy_government
				primary_title = {
					add_law = succ_democracy
				}
			}
		}
		
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 2
				religion = imperialist
			}
		}
	}
}
	
	
targetted_decisions = {

	ask_to_join_eu = {
		only_rulers = yes
		is_high_prio = yes

		from_potential = {
			religion_group = capitalist
			NOT = { has_character_flag = refused_for_eu }
			e_european_union = {
				has_holder = yes 
			}
		}
		
		potential = {
			has_landed_title = e_european_union
		}
	
		allow = {
			FROM = {
				eligible_to_ue_trigger = yes
			}
			ROOT = {
				prisoner = no
				is_incapable = no
				is_adult = yes
			}
		}
		
		effect = {
			FROM = {
				set_character_flag = asking_for_eu
			}
			ROOT = {
				set_character_flag = asked_for_eu
			}
		}
		
		ai_will_do = {
			factor = 0.001
			modifier = {
				factor = 0.00005
				religion = imperialist
			}
			modifier = {
				factor = 0.00005
				religion = ambitious
			}
			modifier = {
				factor = 0.009
				any_realm_province = {
					any_neighbor_province = {
						owner = {
							top_liege = {
								character = ROOT
							}
						}
					}
				}
			}
			modifier = {
				factor = 0
				ROOT = {
					NOT = { religion_group = capitalist }
				}
			}
		}
	}
}