
decisions = {
	become_attila = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
    		any_owned_bloodline = {
				OR = {
					has_bloodline_flag = attila_the_hun
					has_bloodline_flag = second_attila
				}
				founder = {
    				NOT = { character = ROOT }
    				is_alive = no
    			}
			}
			OR = {
				prestige = 1000
				diplomacy = 20
				martial = 20
				stewardship = 20
				intrigue = 20
				learning = 20
				trait = genius
				AND = {
					OR = {
						trait = proud
						trait = ambitious
						trait = lunatic
						trait = possessed
					}
					OR = {
						diplomacy = 16
						martial = 16
						stewardship = 16
						intrigue = 16
						learning = 16
					}
				}
			}
			diplomacy = 1
			martial = 1
			stewardship = 1
			intrigue = 1
			learning = 1
		}
		allow = {
			prisoner = no
			NOT = { trait = incapable }
			prestige = 5000
    		any_owned_bloodline = {
				custom_tooltip = { text = must_be_blood_of_attila }
				has_bloodline_flag = attila_the_hun
				founder = {
    				NOT = { character = ROOT }
    				is_alive = no
    			}
				NOT = {
					any_bloodline_member = {
						is_reincarnated = yes
					}
    			}
			}
			NOT = { trait = reincarnation }
		}
		effect = {
			prestige = -5000
			random_owned_bloodline = {
				limit = {
					has_bloodline_flag = attila_the_hun
				}
				founder = {
					save_event_target_as = reincarnation_founder
					ROOT = {
						set_reincarnation = PREV
					}
				}
			}
			add_trait = reincarnation
			hidden_tooltip = {
				any_playable_ruler = {
					limit = {
						ai = no
						NOT = { character = FROM }
					}
					character_event = { id = HAMANE_NOTIFICATIONS.2 }
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				ai = yes
			}
		}
	}
	change_hun = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 12
		potential = {
			NOT = { culture = hun }
			OR = {
				any_owned_bloodline = {
					OR = {
						has_bloodline_flag = attila_the_hun
						has_bloodline_flag = second_attila
					}
				}
				any_demesne_title = {
					title = e_hun_empire
				}
			}
			NOT = { culture = hun }
		}
		allow = {
			prestige = 200
			NOT = {
				government = nomadic_government
			}
			any_demesne_title = {
				title = e_hun_empire
			}
			any_owned_bloodline = {
				custom_tooltip = { text = must_be_blood_of_attila }
				has_bloodline_flag = attila_the_hun
			}
			NOT = { culture = hun }
		}
		effect = {
			prestige = -200
			culture = hun
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
#			modifier = {
#				factor = 0
#				NAND = {
#					trait = possessed
#					trait = lunatic
#					trait = proud
#					trait = ambitious
#				}
#			}
		}
	}
	get_hun = {
		only_playable = yes
		is_high_prio = yes
		ai_check_interval = 36
		potential = {
			NOT = { has_global_flag = revival_hun }
			independent = yes
			higher_tier_than = DUKE
			NOT = {
				e_hun_empire = { has_holder = yes }
			}
			OR = {
				any_owned_bloodline = {
					has_bloodline_flag = attila_the_hun
				}
				is_landed_title_allowed = k_dacia
				is_landed_title_allowed = k_ruthenia
				is_landed_title_allowed = k_hungary
				is_landed_title_allowed = k_poland
				is_landed_title_allowed = k_bohemia
			}
		}
		allow = {
			is_adult = yes
			prisoner = no
			NOT = { trait = incapable }
			prestige = 8000
			realm_size = 180
			any_demesne_title = {
				OR = {
					title = k_dacia
					title = k_ruthenia
					title = k_hungary
					title = k_poland
					title = k_bohemia
				}
			}
			OR = {
				any_owned_bloodline = {
					custom_tooltip = { text = must_be_blood_of_attila }
					has_bloodline_flag = attila_the_hun
				}
				any_spouse = {
					any_owned_bloodline = {
						custom_tooltip = { text = must_be_blood_of_attila }
						has_bloodline_flag = attila_the_hun
					}
				}
				mother_even_if_dead = {
					any_owned_bloodline = {
						custom_tooltip = { text = must_be_blood_of_attila }
						has_bloodline_flag = attila_the_hun
					}
				}
			}
			wealth = 1000
		}
		effect = {
			set_global_flag = revival_hun
			prestige = -8000
			wealth = -1000
			primary_title = {
				e_hun_empire = {
					grant_title = ROOT
					copy_title_laws = PREV
					make_primary_title = yes
				}
			}
			narrative_event = { id = HAMANE_NOTIFICATIONS.1 }
			any_playable_ruler = {
				limit = {
					ai = no
					NOT = { character = FROM }
				}
				character_event = { id = HAMANE_NOTIFICATIONS.2 }
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
	}
}