
decisions = {
	recruit_troops_norse = {
		only_rulers = yes
		ai_check_interval = 16
		
		potential = {
			is_ruler = yes
			has_character_flag = raiding_adventurer
			ai = yes
			war = no
			OR = { #Adventurers want to save money after 5 years
				AND = {
					wealth = 25
					NOT = { had_character_flag = { flag = raiding_adventurer days = 1825 } }
				}
				AND = {
					wealth = 375
					had_character_flag = { flag = raiding_adventurer days = 1825 }
				}	
			}
			NOT = { realm_levies = 6000 }
			NOT = { government = nomadic_government }
			OR = {
				AND = {
					year = 700
					NOT = { year = 900 }
					NOT = { realm_levies = 5500 }
				}
				AND = {
					year = 900
					NOT = { year = 1000 }
					NOT = { realm_levies = 6100 }
				}
				AND = {
					year = 1000
					NOT = { year = 1100 }
					NOT = { realm_levies = 6500 }
				}
				AND = {
					year = 1100
					NOT = { year = 1150 }
					NOT = { realm_levies = 6800 }
				}
				AND = {
					year = 1150
					NOT = { year = 1200 }
					NOT = { realm_levies = 7100 }
				}
				AND = {
					year = 1200
					NOT = { year = 1250 }
					NOT = { realm_levies = 8500 }
				}
				AND = {
					year = 1250
					NOT = { realm_levies = 9800 }
				}
			}
		}
		
		effect = {
			wealth = -15
			location = {
				ROOT = {
					spawn_unit = {
						province = PREV
						owner = THIS
						leader = none
						attrition = 0
						reinforces = yes
						is_looter = yes
						can_toggle_looting = no
						cannot_inherit = yes
						troops = {
							light_infantry = { 1 500 }
							heavy_infantry = { 1 40 }
							archers = { 1 200 }
						}
						merge = yes
					}
				}
			}
			change_variable = { which = global_raiding_adventurer_recruit_troops value = 1 }
		}
		
		ai_will_do = {
			factor = 1
			#modifier = {
			#	factor = 0.1
			#}
		}
	}
	recruit_troops_nomad = {
		only_rulers = yes
		ai_check_interval = 16
		potential = {
			is_ruler = yes
			has_character_flag = raiding_adventurer
			has_character_flag = raiding_adventurer_nomad
			ai = yes
			war = no
			OR = { #Adventurers want to save money after 5 years
				AND = {
					wealth = 25
					NOT = { had_character_flag = { flag = raiding_adventurer days = 1825 } }
				}
				AND = {
					wealth = 375
					had_character_flag = { flag = raiding_adventurer days = 1825 }
				}
			}
			OR = {
				AND = {
					year = 700
					NOT = { year = 900 }
					NOT = { realm_levies = 4000 }
				}
				AND = {
					year = 900
					NOT = { year = 1000 }
					NOT = { realm_levies = 4400 }
				}
				AND = {
					year = 1000
					NOT = { year = 1100 }
					NOT = { realm_levies = 4700 }
				}
				AND = {
					year = 1100
					NOT = { year = 1150 }
					NOT = { realm_levies = 4900 }
				}
				AND = {
					year = 1150
					NOT = { year = 1200 }
					NOT = { realm_levies = 5300 }
				}
				AND = {
					year = 1200
					NOT = { year = 1250 }
					NOT = { realm_levies = 6100 }
				}
				AND = {
					year = 1250
					NOT = { realm_levies = 7600 }
				}
			}
		}
		
		effect = {
			wealth = -15
			location = {
				ROOT = {
					spawn_unit = {
						province = PREV
						owner = THIS
						leader = none
						attrition = 0
						reinforces = yes
						is_looter = yes
						can_toggle_looting = no
						cannot_inherit = yes
						troops = {
							light_cavalry = { 1 250 }
							horse_archers = { 1 250 }
						}
						merge = yes
					}
				}
			}
			change_variable = { which = global_raiding_adventurer_recruit_troops value = 1 }
		}
		
		ai_will_do = {
			factor = 1
			#modifier = {
			#	factor = 0.1
			#}
		}
	}
	become_genghis_khan = {
		only_independent = yes
		is_high_prio = yes
		only_playable = yes
		ai_check_interval = 12
		
		potential = {
			has_dlc = "Horse Lords"
			NOT = { has_global_flag = mongol_horde_united }
			government = nomadic_government
			is_playable = yes
			independent = yes
			culture = mongol
		}
		
		allow = {
			num_of_count_titles_in_realm = 35
			prestige = 1500
		}
		
		effect = {
			set_global_flag = mongol_horde_arrival
			set_global_flag = mongol_horde_united
			set_special_character_title = GENGHIS_KHAN
			prestige = 1000
			add_character_modifier = {
				modifier = greatest_of_khans
				duration = -1
			}
			if = {
				limit = {
					NOT = {
						e_mongol_empire = {
							holder_scope = { always = yes }
						}
					}
				}
				any_demesne_title = {
					limit = {
						tier = EMPEROR
					}
					set_title_flag = to_be_destroyed
				}
				e_mongol_empire = {
					hidden_tooltip = {
						activate_title = { title = THIS status = yes }
					}
					grant_title = PREV
					make_primary_title = yes
				}
				any_demesne_title = {
					limit = {
						has_title_flag = to_be_destroyed
					}
					activate_title = { title = THIS status = no }
					destroy_landed_title = THIS
				}
			}
			if = {
				limit = {
					ai = yes
				}
				character_event = { id = 60530 } # ai reinforcements
				population = 50000
			}
			hidden_tooltip = {
				any_playable_ruler = {
					narrative_event = { id = 60520 } # notify the world
				}
				narrative_event = { id = 60520 } # and myself
			}
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	become_genghis_khan_tribal = {
		only_independent = yes
		is_high_prio = yes
		ai_check_interval = 12
		only_playable = yes
		
		potential = {
			NOT = { has_dlc = "Horse Lords" }
			NOT = { has_global_flag = mongol_horde_united }
			government = tribal_government
			culture = mongol
			is_playable = yes
			independent = yes
		}
		
		allow = {
			culture = mongol
			government = tribal_government
			num_of_count_titles_in_realm = 35
			prestige = 1500
		}
		
		effect = {
			set_global_flag = mongol_horde_arrival
			set_global_flag = mongol_horde_united
			set_special_character_title = GENGHIS_KHAN
			prestige = 1000
			add_character_modifier = {
				modifier = greatest_of_khans
				duration = -1
			}
			if = {
				limit = {
					NOT = {
						e_mongol_empire = {
							holder_scope = { always = yes }
						}
					}
				}
				any_demesne_title = {
					limit = {
						tier = EMPEROR
					}
					set_title_flag = to_be_destroyed
				}
				e_mongol_empire = {
					activate_title = { title = THIS status = yes }
					grant_title = PREV
				}
				any_demesne_title = {
					limit = {
						has_title_flag = to_be_destroyed
					}
					activate_title = { title = THIS status = no }
					destroy_landed_title = THIS
				}
			}
			if = {
				limit = {
					ai = yes
				}
				character_event = { id = 60530 } # ai reinforcements
			}
			hidden_tooltip = {
				any_playable_ruler = {
					narrative_event = { id = 60520 } # notify the world
				}
				narrative_event = { id = 60520 } # and myself
			}
		}
		
		ai_will_do = {
			factor = 1
		}
	}
}