decisions = {
	restore_western_roman_empire = {
		is_high_prio = yes
		only_playable = yes
		ai_check_interval = 60

		potential = {
	        has_dlc = "Legacy of Rome"
			culture = roman
			OR = {
				religion_group = christian
				religion = hellenic_pagan
				religion = hellenic_pagan_reformed
			}			
			NOT = { has_landed_title = e_byzantium }
			NOT = { has_landed_title = e_hre }
			higher_tier_than = COUNT
			e_wre = {
				has_holder = no
			}
			e_roman_empire = {
				has_holder = no
			}
			
		}
		allow = {
			war = no
			prestige = 1000
			completely_controls = d_latium
			completely_controls = d_venice
			completely_controls = d_ferrara
			completely_controls = d_sicily
			completely_controls = d_genoa
			completely_controls = d_capua
			completely_controls = d_apulia
		}
		effect = {
			custom_tooltip = {
				text = restore_western_roman_empire_TT

				primary_title = {
					save_event_target_as = current_primary_title
				}

				e_wre = {
					copy_title_laws = event_target:current_primary_title
					add_law = succ_feudal_elective
				}

				grant_title = e_wre

				
				c_roma = {
					location = {
						ROOT = {
							capital = PREV
						}
					}
				}
				
				any_demesne_title = {
					limit = {
						NOT = {
							title = e_wre
						}
						higher_tier_than = DUKE
					}
					destroy_landed_title = THIS
				}

				k_italy = {
					de_jure_liege = e_wre
				}

				ROOT = {
					narrative_event = { id = WRE.3 }
				}
				any_playable_ruler = {
					limit = {
						OR = {
							independent = yes
							ai = no
						}
						is_within_diplo_range = ROOT
					}
					narrative_event = { id = WRE.3 }
				}

				if = {
					limit = {
						religion = catholic
					}
				}
			}	
		}
	}
	
	claim_rome = {
		only_independent = yes
		is_high_prio = yes
		
		potential = {
			is_nomadic = no
			is_playable = yes
			has_dlc = "Legacy of Rome"
			has_landed_title = e_wre
			NOT = { has_landed_title = c_roma }
			any_realm_lord = { 
				ai = yes
				has_landed_title = c_roma
			}
		}
		allow = {
			NOT = { has_landed_title = c_roma }
			any_realm_lord = { 
				has_landed_title = c_roma
			}
		}
		effect = {
			ROOT = {
				c_roma = {
					usurp_title_plus_barony_if_unlanded_and_vassals = PREV
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}	

    restore_wre_roman_empire = {
		only_independent = yes
		is_high_prio = yes
		ai_check_interval = 24
		
		potential = {
			is_playable = yes
			has_dlc = "Legacy of Rome"
			has_landed_title = e_wre
			OR = { 
				religion_group = christian 
				religion = hellenic_pagan 
				religion = hellenic_pagan_reformed
			}
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
			NOT = { has_global_flag = rome_restored }
			NOR = {
				has_alternate_start_parameter = { key = religion_names value = random }
			}
		}
		allow = {
			primary_title = { title = e_wre }
			prestige = 3000
			completely_controls = d_latium
			completely_controls = d_venice
			completely_controls = d_ferrara
			completely_controls = d_sicily
			completely_controls = d_genoa
			completely_controls = d_capua
			completely_controls = d_apulia
			completely_controls = d_thrace
			completely_controls = d_antioch
			completely_controls = d_jerusalem
			completely_controls = d_alexandria
			completely_controls = d_athens
			completely_controls = d_tunis
			completely_controls = d_croatia
		}
		effect = {
			set_global_flag = rome_restored
			narrative_event = { id = WRE.1 tooltip = restore_wre_roman_empire_TT }
		}
		ai_will_do = {
			factor = 1
		}
	}