############################################################################################################
#	Expert AI mod
############################################################################################################

### Note
# Slot RANK and _advisor_rank in character/idea files must match when changing pick order

EAI_ADVISOR_country_has_pick_order = {

	OR = {
		tag = GER
		tag = ITA
		tag = JAP

		tag = USA
		tag = ENG
		tag = FRA

		tag = SOV

		tag = FIN
		tag = CHI
	}
}

EAI_ADVISOR_pickorder_JAP = {

	has_game_rule = { rule = JAP_ai_behavior option = DEFAULT }
	
	### SLOT: POLITICAL 1
	####################################

		set_temp_variable = { RANK = 1 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_takahashi_korekiyo

				NOT = {
					has_country_flag = JAP_takahashi_korekiyo_was_killed
					has_idea = JAP_okinori_kaya
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_takahashi_korekiyo = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	### SLOT: POLITICAL 2
	####################################

		set_temp_variable = { RANK = 2 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_mitsumasa_yonai

				has_completed_focus = JAP_konoes_first_cabinet

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_mitsumasa_yonai = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: POLITICAL 3
	####################################

		set_temp_variable = { RANK = 3 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_kenjiro_matsumoto

				NOT = {
					has_government = communism
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_kenjiro_matsumoto = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: ARMY COMMAND
	####################################

		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_kanin_kotohito

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_kanin_kotohito = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: NAVY COMMAND
	####################################

		set_temp_variable = { RANK = 6 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_shigetaro_shimada

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_shigetaro_shimada = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: AIR COMMAND
	####################################

		set_temp_variable = { RANK = 7 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_kenji_doihara

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_kenji_doihara = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 1
	####################################
	
		set_temp_variable = { RANK = 8 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_yasuji_okamura

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_yasuji_okamura = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 2
	####################################

		set_temp_variable = { RANK = 9 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				NOT = {
					has_country_flag = JAP_jotaro_watanabe_was_killed
				}

			### Rank availability requirements

				has_character = JAP_jotaro_watanabe

				NOT = {
					has_country_flag = JAP_jotaro_watanabe_was_killed
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_jotaro_watanabe = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

		set_temp_variable = { RANK = 12 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				has_country_flag = JAP_jotaro_watanabe_was_killed

			### Rank availability requirements

				has_character = JAP_heisuke_yanagawa

				has_country_flag = JAP_jotaro_watanabe_was_killed

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_heisuke_yanagawa = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 3
	####################################

		set_temp_variable = { RANK = 10 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_chuuichi_nagumo

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_chuuichi_nagumo = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Theorist
	####################################

		set_temp_variable = { RANK = 11 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_tomoyuki_yamashita

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_tomoyuki_yamashita = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Industrial
	####################################

		set_temp_variable = { rank = 4 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_completed_focus = JAP_approach_yasuda

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					has_idea = yasuda_zaibatsu

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	###
}

EAI_ADVISOR_pickorder_CHI = {

	has_game_rule = { rule = CHI_ai_behavior option = DEFAULT }
	
	### SLOT: POLITICAL 1
	####################################

		set_temp_variable = { RANK = 1 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = CHI_chiang_ching_kuo

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					CHI_chiang_ching_kuo = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	### SLOT: POLITICAL 2
	####################################
	
	### SLOT: POLITICAL 3
	####################################
	
	### SLOT: ARMY COMMAND
	####################################

		set_temp_variable = { RANK = 3 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = CHI_he_yingqin

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					CHI_he_yingqin = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: NAVY COMMAND
	####################################
	
	### SLOT: AIR COMMAND
	####################################
	
	### SLOT: HIGH COMMAND 1
	####################################
	
		set_temp_variable = { RANK = 2 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = CHI_xiao_yisu

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					CHI_xiao_yisu = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 2
	####################################

		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = CHI_zhang_zhizhong

				has_dlc = "No Compromise, No Surrender"

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					CHI_zhang_zhizhong = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 3
	####################################
	
	### SLOT: Theorist
	####################################

		set_temp_variable = { RANK = 6 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = CHI_jiang_baili

				has_dlc = "No Compromise, No Surrender"

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					CHI_jiang_baili = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Industrial
	####################################

		set_temp_variable = { RANK = 4 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements
			

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					has_idea = CHI_bank_of_china

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	###
}

EAI_ADVISOR_pickorder_GER = {

	has_game_rule = { rule = GER_ai_behavior option = DEFAULT }
	
	### SLOT: POLITICAL 1
	####################################

		set_temp_variable = { RANK = 1 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = GER_hjalmar_schacht

				has_dynamic_modifier = { modifier = GER_mefo_bills_modifier }
				NOT = { has_government = communism }
				GER_walther_funk = {
					is_hired_as_advisor  = no 
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_hjalmar_schacht = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	### SLOT: POLITICAL 2
	####################################

		set_temp_variable = { RANK = 3 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = GER_wilhelm_canaris

				NOT = { 
					has_completed_focus = GER_reorganize_secret_services
					has_completed_focus = GER_start_the_proletarian_revolution
				}
				has_intelligence_agency = yes

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_wilhelm_canaris = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: POLITICAL 3
	####################################

		set_temp_variable = { RANK = 10 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = GER_walther_funk

				has_government = fascism
				GER_hjalmar_schacht = {
					is_hired_as_advisor  = no 
				}
				GER_ludwig_erhard = {
					is_hired_as_advisor = no
				}
				has_government = fascism
				NOT = {
					OR = {
						has_completed_focus = GER_oppose_hitler
						has_completed_focus = GER_oppose_hitler_ww
					}
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_walther_funk = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

		set_temp_variable = { RANK = 11 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				NOT = { GER_hjalmar_schacht = { is_hired_as_advisor = yes } }

			### Rank availability requirements

				has_character = GER_reinhard_heydrich

				OR = {
					has_government = fascism
					has_country_flag = GER_reinstated_nazi_leadership
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_reinhard_heydrich = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: ARMY COMMAND
	####################################

		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = GER_walther_von_brauchitsch

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_walther_von_brauchitsch = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: NAVY COMMAND
	####################################

		set_temp_variable = { RANK = 6 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = JAP_shigetaro_shimada

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					JAP_shigetaro_shimada = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: AIR COMMAND
	####################################

		set_temp_variable = { RANK = 4 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = GER_ritter_von_greim

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_ritter_von_greim = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 1
	####################################
	
		set_temp_variable = { RANK = 7 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = GER_gerd_von_rundstedt

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_gerd_von_rundstedt = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 2
	####################################

		set_temp_variable = { RANK = 8 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE }

			### Rank availability requirements

				has_character = GER_hugo_sperrle

				has_completed_focus = GER_dive_bombers

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_hugo_sperrle = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

		set_temp_variable = { RANK = 8 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				NOT = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } }

			### Rank availability requirements

				has_character = GER_erwin_rommel

				has_completed_focus = GER_adopt_new_panzer_doctrine

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_erwin_rommel = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 3
	####################################

		set_temp_variable = { RANK = 10 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = GER_ferdinand_schorner

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_ferdinand_schorner = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Theorist
	####################################

		set_temp_variable = { RANK = 12 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				NOT = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } }

			### Rank availability requirements

				has_character = GER_heinz_guderian

				has_completed_focus = GER_adopt_new_panzer_doctrine

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_heinz_guderian = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

		set_temp_variable = { RANK = 12 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE }

			### Rank availability requirements

				has_character = GER_ernst_udet

				has_completed_focus = GER_dive_bombers

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					GER_ernst_udet = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Industrial
	####################################

		set_temp_variable = { rank = 2 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_completed_focus = GER_establish_the_reichswerke

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					OR = {
						has_idea = GER_organization_todt
						has_idea = GER_organization_todt_improved
						has_idea = GER_philipp_holzmann
						has_idea = GER_philipp_holzmann_improved
						has_idea = GER_philipp_holzmann_improved_2
						has_idea = GER_philipp_holzmann_improved_2_no_aat
						has_idea = GER_reichswerke
						has_idea = GER_reichswerke_improved
						has_idea = GER_reichswerke_improved_2
					}

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	###
}

EAI_ADVISOR_pickorder_ENG = {

	has_game_rule = { rule = ENG_ai_behavior option = DEFAULT }
	
	### SLOT: POLITICAL 1
	####################################

		set_temp_variable = { RANK = 1 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_philip_kerr

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_philip_kerr = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	### SLOT: POLITICAL 2
	####################################

		set_temp_variable = { RANK = 2 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_maxwell_aitken

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_maxwell_aitken = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: POLITICAL 3
	####################################

		set_temp_variable = { RANK = 9 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = eng_stewart_menzies

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					eng_stewart_menzies = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: ARMY COMMAND
	####################################

		set_temp_variable = { RANK = 3 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_alan_brooke

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_alan_brooke = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: NAVY COMMAND
	####################################

		set_temp_variable = { RANK = 4 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_ernle_chatfield

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_ernle_chatfield = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: AIR COMMAND
	####################################

		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_charles_portal

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_charles_portal = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 1
	####################################
	
		set_temp_variable = { RANK = 6 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_kenneth_anderson

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_kenneth_anderson = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 2
	####################################

		set_temp_variable = { RANK = 7 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_sholto_douglas

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_sholto_douglas = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 3
	####################################

		set_temp_variable = { RANK = 8 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ENG_henry_harwood

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ENG_henry_harwood = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Theorist
	####################################
	
	### SLOT: Industrial
	####################################

	###
}

EAI_ADVISOR_pickorder_ITA = {

	has_game_rule = { rule = ITA_ai_behavior option = DEFAULT }
	
	### SLOT: POLITICAL 1
	####################################

		set_temp_variable = { RANK = 1 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_adelchi_serena

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_adelchi_serena = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	### SLOT: POLITICAL 2
	####################################

		set_temp_variable = { RANK = 2 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_alberto_beneduce

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_alberto_beneduce = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: POLITICAL 3
	####################################

		set_temp_variable = { RANK = 3 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				set_temp_variable = { tmp_wants_mic = EAI_BUILDING_build_num_MIC } 
				subtract_from_temp_variable = { tmp_wants_mic = num_of_military_factories } 
				check_variable = { tmp_wants_mic > 2 }

			### Rank availability requirements

				has_character = ITA_giacomo_acerbo

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_giacomo_acerbo = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: ARMY COMMAND
	####################################

		set_temp_variable = { RANK = 4 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_ugo_cavallero

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_ugo_cavallero = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: NAVY COMMAND
	####################################

		set_temp_variable = { RANK = 6 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_inigo_campioni

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_inigo_campioni = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: AIR COMMAND
	####################################

		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_aldo_pellegrini

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_aldo_pellegrini = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				NOT = { has_character = ITA_aldo_pellegrini }

			### Rank availability requirements

				has_character = ITA_italo_balbo

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_italo_balbo = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 1
	####################################
	
		set_temp_variable = { RANK = 7 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_alfredo_guzzoni

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_alfredo_guzzoni = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 2
	####################################

		set_temp_variable = { RANK = 8 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_ettore_muti

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_ettore_muti = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 3
	####################################

		set_temp_variable = { RANK = 9 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = ITA_carlo_bergamini

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					ITA_carlo_bergamini = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Theorist
	####################################
	
	### SLOT: Industrial
	####################################

	###
}

EAI_ADVISOR_pickorder_USA = {

	has_game_rule = { rule = USA_ai_behavior option = DEFAULT }
	
	### SLOT: POLITICAL 1
	####################################

		set_temp_variable = { RANK = 1 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_henry_morgenthau

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_henry_morgenthau = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	### SLOT: POLITICAL 2
	####################################

		set_temp_variable = { RANK = 2 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_robert_taft

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_robert_taft = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: POLITICAL 3
	####################################

		set_temp_variable = { RANK = 4 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_henry_stimson

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_henry_stimson = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: ARMY COMMAND
	####################################

		set_temp_variable = { RANK = 3 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_dwight_d_eisenhower

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_dwight_d_eisenhower = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: NAVY COMMAND
	####################################

		set_temp_variable = { RANK = 6 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_ernest_king

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_ernest_king = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: AIR COMMAND
	####################################

		set_temp_variable = { RANK = 7 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_carl_spaatz

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_carl_spaatz = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 1
	####################################
	
		set_temp_variable = { RANK = 8 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_mark_clark

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_mark_clark = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 2
	####################################

		set_temp_variable = { RANK = 9 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_claire_lee_chennault

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_claire_lee_chennault = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 3
	####################################

		set_temp_variable = { RANK = 10 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = USA_courtney_hodges

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					USA_courtney_hodges = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: Theorist
	####################################
	
	### SLOT: Industrial
	####################################

		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_completed_focus = USA_wartime_industry

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					has_idea = USA_general_motors

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	###
}

EAI_ADVISOR_pickorder_SOV = {

	has_game_rule = { rule = SOV_ai_behavior option = DEFAULT }
	
	### SLOT: POLITICAL 1
	####################################

		set_temp_variable = { RANK = 1 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = SOV_nikolay_voznesensky

				SOV_nikolay_voznesensky = { 
					is_advisor = yes 
					NOT = { 
						has_character_flag = SOV_exiled_flag 
						has_character_flag = SOV_character_purged_flag 
					} 
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					SOV_nikolay_voznesensky = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}

	### SLOT: POLITICAL 2
	####################################

		set_temp_variable = { RANK = 2 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = SOV_mikhail_kalinin

				SOV_mikhail_kalinin = { 
					is_advisor = yes 
					NOT = { 
						has_character_flag = SOV_exiled_flag 
						has_character_flag = SOV_character_purged_flag 
					} 
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					SOV_mikhail_kalinin = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: POLITICAL 3
	####################################
	
	### SLOT: ARMY COMMAND
	####################################

		set_temp_variable = { RANK = 3 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = SOV_semyon_timoshenko

				SOV_semyon_timoshenko = { 
					is_advisor = yes 
					NOT = { 
						has_character_flag = SOV_exiled_flag 
						has_character_flag = SOV_character_purged_flag 
					} 
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					SOV_semyon_timoshenko = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: NAVY COMMAND
	####################################
	
	### SLOT: AIR COMMAND
	####################################

		set_temp_variable = { RANK = 4 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = SOV_pavel_rychagov

				SOV_pavel_rychagov = { 
					is_advisor = yes 
					NOT = { 
						has_character_flag = SOV_exiled_flag 
						has_character_flag = SOV_character_purged_flag 
					} 
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					SOV_pavel_rychagov = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 1
	####################################
	
		set_temp_variable = { RANK = 5 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = SOV_aleksandr_vasilevsky

				SOV_aleksandr_vasilevsky = { 
					is_advisor = yes 
					NOT = { 
						has_character_flag = SOV_exiled_flag 
						has_character_flag = SOV_character_purged_flag 
					} 
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					SOV_aleksandr_vasilevsky = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 2
	####################################

		set_temp_variable = { RANK = 6 }
		if = { limit = { check_variable = { var = _advisor_rank value = RANK compare = greater_than_or_equals }

			### Rank enable conditions

				always = yes

			### Rank availability requirements

				has_character = SOV_ivan_konev

				SOV_ivan_konev = { 
					is_advisor = yes 
					NOT = { 
						has_character_flag = SOV_exiled_flag 
						has_character_flag = SOV_character_purged_flag 
					} 
				}

			###

			} OR = { AND = {

				### Rank fulfilled conditions
				
					SOV_ivan_konev = { is_hired_as_advisor = yes }

				###

			} check_variable = { _advisor_rank = RANK } }
		}
	
	### SLOT: HIGH COMMAND 3
	####################################
	
	### SLOT: Theorist
	####################################
	
	### SLOT: Industrial
	####################################

	###
}