decisions = {
	
	
}





targeted_decisions = {

	#player only,to show missions
	ipc_show_assignable_missions = {
		only_playable = yes
		ai = no
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = all_including_me
		
		from_potential = {
			ai = no
			NOT = { has_character_modifier = ipc_missions_list_modifier }
			is_imperial_court_member_trigger = yes
			is_society_grandmaster = yes
		}
		allow = { always = yes }
		effect = { FROM = { add_character_modifier = { modifier = ipc_missions_list_modifier duration = -1 } } }
	}
	ipc_hide_assignable_missions = {
		only_playable = yes
		ai = no
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = all_including_me
		
		from_potential = {
			ai = no
			has_character_modifier = ipc_missions_list_modifier
			is_imperial_court_member_trigger = yes
			is_society_grandmaster = yes
		}
		allow = { always = yes }
		effect = { FROM = { remove_character_modifier = ipc_missions_list_modifier } }
	}

	
	
	improve_imperial_capital_mission_decision = { #seneschal
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = self
		ai_target_filter = self
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		show_third_party_potential = yes
		
		from_potential = { can_assign_imperial_court_missions_potential_trigger = yes }
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_stewardship_trigger = yes
					stewardship = 15
					hidden_tooltip = { ai = no }
				}
			}
		}
		potential = { always = yes }
		allow = {
			FROM = {
				can_assign_seneschal_missions_trigger = yes 
				society_currency >= 300
				can_interact_with_imperial_court_revolt_trigger = yes
			}
			custom_tooltip = {
				text = improve_imperial_capital_mission_decision_allow
				NOT = {
					society = {
						any_society_member = { has_quest = quest_ipc_improve_imperial_capital }
					}
				}
			}
			custom_tooltip = {
				text = improve_imperial_capital_mission_decision_allow_2
				OR = {
					AND = {
						tier = emperor
						any_demesne_title = {
							has_title_flag = is_imperial_capital
							NAND = {
								has_building = ipc_imperial_barracks_3
								has_building = ipc_imperial_training_grounds_3
								has_building = ipc_imperial_tax_center_3
								has_building = ipc_imperial_library_3
								has_building = ipc_imperial_council_halls_3
								has_building = ipc_imperial_palace_3
							}
						}
					}
					AND = {
						NOT = { tier = emperor }
						top_liege = {
							any_demesne_title = {
								has_title_flag = is_imperial_capital
								NAND = {
									has_building = ipc_imperial_barracks_3
									has_building = ipc_imperial_training_grounds_3
									has_building = ipc_imperial_tax_center_3
									has_building = ipc_imperial_library_3
									has_building = ipc_imperial_council_halls_3
									has_building = ipc_imperial_palace_3
								}
							}
						}
					}
				}
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -300 }
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				FROMFROM = { society_quest_event = { id = ipcq.110 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			seneschal_mission_candidate_score_value = yes
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					trait = administrator
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = architect
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					trait = gardener
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					is_loyal_to_empire_trigger = yes
				}
			}
		}
		
		ai_check_interval = 12
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
		}
	}
	
	
	organize_military_drill_mission_decision = { #marshal
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = self
		ai_target_filter = self
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		show_third_party_potential = yes
		
		from_potential = { can_assign_imperial_court_missions_potential_trigger = yes }
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_martial_trigger = yes
					martial = 15
					hidden_tooltip = { ai = no }
				}
			}
		}
		potential = { always = yes }
		allow = {
			FROM = {
				can_assign_marshal_missions_trigger = yes 
				society_currency >= 250
				can_interact_with_imperial_court_revolt_trigger = yes
				custom_tooltip = {
					text = organize_military_drill_mission_decision_allow
					NOT = {
						society = {
							any_society_member = { has_quest = quest_ipc_military_drill }
						}
					}
				}
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -250 }
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				FROMFROM = { society_quest_event = { id = ipcq.200 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			marshal_mission_candidate_score_value = yes
			additive_modifier = {
				value = 15
				FROMFROM = {
					show_scope_change = no
					trait = strategist
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					leader_traits == 1
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					leader_traits == 2
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					trait = inspiring_leader
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					prestige = 500
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					prestige = 1000
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					is_loyal_to_empire_trigger = yes
				}
			}
		}
		
		ai_check_interval = 12
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
		}
	}
	
	distribute_levy_recompense_mission_decision = { #marshal
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = self
		ai_target_filter = self
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		show_third_party_potential = yes
		
		from_potential = { can_assign_imperial_court_missions_potential_trigger = yes }
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_martial_trigger = yes
					martial = 15
					hidden_tooltip = { ai = no }
				}
			}
		}
		potential = { always = yes }
		allow = {
			FROM = {
				can_assign_marshal_missions_trigger = yes 
				society_currency >= 150
				can_interact_with_imperial_court_revolt_trigger = yes
				custom_tooltip = {
					text = distribute_levy_recompense_mission_decision_allow
					OR = {
						AND = {
							tier = emperor
							war = yes
						}
						top_liege = { war = yes }
					}
				}
				custom_tooltip = {
					text = distribute_levy_recompense_mission_decision_allow2
					OR = {
						AND = {
							tier = emperor
							any_vassal = { count = 5 opinion_levy_raised_days = { who = liege days = 30 } }
						}
						AND = {
							NOT = { tier = emperor }
							top_liege = { any_vassal = { count = 5 opinion_levy_raised_days = { who = liege days = 30 } } }
						}
					}
				}
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -150 }
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				FROMFROM = { society_quest_event = { id = ipcq.210 days = 1 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			marshal_mission_candidate_score_value = yes
			ipc_combat_rating_mission_score_value = yes
			additive_modifier = {
				value = 15
				FROMFROM = {
					show_scope_change = no
					trait = organizer
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					is_landed = no
				}
			}
			additive_modifier = {
				value = -10
				FROMFROM = {
					show_scope_change = no
					is_ill = yes
				}
			}
		}
		
		ai_check_interval = 6
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
			modifier = {
				factor = 5
				FROM = { tier = emperor }
			}
		}
	}
	
	change_culture_mission_decision = { #lawkeeper
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = realm
		ai_target_filter = realm
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		show_third_party_potential = yes
		
		from_potential = { can_assign_imperial_court_missions_potential_trigger = yes }
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_diplomacy_trigger = yes
					ipc_has_education_learning_trigger = yes
					hidden_tooltip = { ai = no }
				}
				top_liege = { show_scope_change = no ROOT = { show_scope_change = no FROMFROM = { show_scope_change = no culture = PREVPREV } } }
			}
		}
		potential = { 
			NOT = { top_liege = { culture = ROOT } }
		}
		allow = {
			FROM = {
				can_assign_lawkeeper_missions_trigger = yes 
				society_currency >= 150
				OR = {
					tier = emperor
					#has to scope to root first, idk why doesnt work directly
					ROOT = {
						show_scope_change = no
						top_liege = { 
							show_scope_change = no
							culture = FROM
						}
					}
				}
				can_interact_with_imperial_court_revolt_trigger = yes
			}
			ROOT = {
				top_liege = { show_scope_change = no ROOT = { show_scope_change = no  NOT = { culture = PREV } } }
				is_quest_target = no
				is_adult = yes
				is_landed = yes
				can_interact_with_imperial_court_revolt_trigger = yes
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -150 }
			save_event_target_as = change_culture_target
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				FROMFROM = { society_quest_event = { id = ipcq.300 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			lawkeeper_dual_mission_candidate_score_value = yes
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = shrewd
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = socializer
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					trait = gregarious
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					is_liege_of = ROOT
				}
			}
		}
		
		ai_check_interval = 12
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
			modifier = {
				factor = 2
				culture_group = FROM
			}
		}
	}
	
	organize_festival_mission_decision = { #lawkeeper
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = self
		ai_target_filter = self
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		show_third_party_potential = yes
		
		from_potential = { can_assign_imperial_court_missions_potential_trigger = yes }
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_diplomacy_trigger = yes
					diplomacy = 15
					hidden_tooltip = { ai = no }
				}
			}
		}
		potential = { always = yes }
		allow = {
			FROM = {
				can_assign_lawkeeper_missions_trigger = yes 
				society_currency >= 500
				can_interact_with_imperial_court_revolt_trigger = yes
				custom_tooltip = {
					text = organize_festival_mission_decision_allow
					trigger_if = {
						limit = { tier = emperor }
						any_realm_province = { revolt_risk > 0 }
					}
					trigger_else_if = {
						limit = { NOT = { tier = emperor } }
						top_liege = { any_realm_province = { revolt_risk > 0 } }
					}
				}
				custom_tooltip = {
					text = organize_festival_mission_decision_allow2
					NOT = {
						society = {
							any_society_member = { has_quest = quest_ipc_organize_festival }
						}
					}
				}
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -500 }
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				FROMFROM = { society_quest_event = { id = ipcq.310 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			lawkeeper_mission_candidate_score_value = yes
			additive_modifier = {
				value = -5
				FROMFROM = {
					show_scope_change = no
					trait = greedy
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					trait = kind
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					tier = king
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = gregarious
				}
			}
		}
		
		ai_check_interval = 12
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
			modifier = {
				factor = 10
				capital_scope = { revolt_risk >= 5 }
			}
		}
	}
	
	
	investigate_secret_religions_mission_decision = { #spymaster
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = self
		ai_target_filter = self
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		show_third_party_potential = yes
		
		from_potential = { 
			can_assign_imperial_court_missions_potential_trigger = yes 
			OR = {
				has_game_rule = { name = devil_worshipers value = default }
				has_game_rule = { name = secret_cults value = default }
			}
		}
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_intrigue_trigger = yes
					intrigue = 15
					hidden_tooltip = { ai = no }
				}
				top_liege = { show_scope_change = no ROOT = { show_scope_change = no FROMFROM = { show_scope_change = no religion = PREVPREV } } }
			}
		}
		potential = { always = yes }
		allow = {
			FROM = {
				can_assign_spymaster_missions_trigger = yes 
				society_currency >= 350
				can_interact_with_imperial_court_revolt_trigger = yes
				custom_tooltip = {
					text = investigate_secret_religions_mission_decision_allow
					NOT = {
						society = {
							any_society_member = { has_quest = quest_ipc_investigate_secret_religions }
						}
					}
				}
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -350 }
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				FROMFROM = { society_quest_event = { id = ipcq.400 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			spymaster_mission_candidate_score_value = yes
			additive_modifier = {
				value = 15
				FROMFROM = {
					show_scope_change = no
					trait = schemer
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = deceitful
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					is_loyal_to_empire_trigger = yes
				}
			}
		}
		
		ai_check_interval = 16
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
		}
	}
	
	
	infiltrate_court_mission = { #spymaster
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = independent_rulers
		ai_target_filter = independent_rulers
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		show_third_party_potential = yes
		
		from_potential = { can_assign_imperial_court_missions_potential_trigger = yes }
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_intrigue_trigger = yes
					intrigue = 15
					hidden_tooltip = { ai = no }
				}
			}
		}
		potential = {
			is_landed = yes
			is_playable = yes
			independent = yes
			NOT = { same_realm = FROM }
		}
		allow = {
			FROM = {
				can_assign_spymaster_missions_trigger = yes 
				society_currency >= 200
				can_interact_with_imperial_court_revolt_trigger = yes
			}
			ROOT = {
				is_adult = yes
				is_landed = yes
				is_nomadic = no
				war = no
				custom_tooltip = {
					text = infiltrate_court_mission_allow
					NOT = {
						society = {
							any_society_member = { has_quest = quest_ipc_infiltrate_court }
						}
					}
				}
				custom_tooltip = {
					text = infiltrate_court_mission_allow2
					NOT = { any_courtier = { has_character_flag = ipc_infiltrator } }
				}
				can_interact_with_imperial_court_revolt_trigger = yes
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -200 }
			save_event_target_as = infiltrate_court_target
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				FROMFROM = { society_quest_event = { id = ipcq.420 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			
			spymaster_mission_candidate_score_value = yes
			
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					is_loyal_to_empire_trigger = yes
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = deceitful
				}
			}
			additive_modifier = {
				value = 15
				FROMFROM = {
					show_scope_change = no
					custom_tooltip = {
						text = infiltrate_court_mission_modifier
						OR = {
							trait = fair
							AND = {
								age < 40
								ROOT = { age < 40 }
							}
						}
						OR = {
							is_opposite_sex = ROOT
							AND = {
								same_sex = ROOT
								ROOT = { trait = homosexual }
							}
						}
						ROOT = {
							NOR = {
								trait = chaste
								trait = celibate
								trait = eunuch
							}
						}
					}
				}
			}
		}
		
		ai_check_interval = 24
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
		}
	}
	
	
	
	
	
	
	
	
	
	
}






title_decisions = {
	build_imperial_road_mission_decision = { #seneschal
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = realm_owned
		ai_target_filter = realm_owned
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		
		show_third_party_potential = yes
		
		from_potential = { can_assign_imperial_court_missions_potential_trigger = yes }
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_stewardship_trigger = yes
					stewardship = 15
					hidden_tooltip = { ai = no }
				}
			}
		}
		potential = {
			tier = count
			holder_scope = { same_realm = FROM }
			NOT = { location = { has_province_modifier = ipc_imperial_road } }
		}
		allow = {
			FROM = { 
				can_assign_seneschal_missions_trigger = yes 
				society_currency >= 100
				can_interact_with_imperial_court_revolt_trigger = yes
			}
			ROOT = {
				OR = {
					custom_tooltip = {
						text = build_imperial_road_mission_decision_allow
						location = {
							OR = {
								FROM = {
									tier = emperor 
									capital_scope = { province = PREVPREV }
								}
								FROM = {
									NOT = { tier = emperor }
									top_liege = { capital_scope = { province = PREVPREVPREV } }
								}
							}
						}
					}
					custom_tooltip = {
						text = build_imperial_road_mission_decision_allow_2
						location = {
							any_neighbor_province = {
								owner = { show_scope_change = no same_realm = FROM }
								has_province_modifier = ipc_imperial_road
							}
						}
					}
				}
				custom_tooltip = {
					text = build_imperial_road_mission_decision_allow_3
					location = { NOT = { has_province_modifier = building_imperial_road } }
				}
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -100 }
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				location = { 
					add_province_modifier = { modifier = building_imperial_road years = 1 hidden = yes }
					save_event_target_as = imperial_road_province
				}
				FROMFROM = { society_quest_event = { id = ipcq.100 } }
			}
		}
		
		third_party_score = {
			factor = 10
			
			seneschal_mission_candidate_score_value = yes
			additive_modifier = {
				value = 20
				FROMFROM = {
					show_scope_change = no
					trait = administrator
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = architect
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					trait = strategist
				}
			}
			additive_modifier = {
				value = 100
				FROMFROM = {
					show_scope_change = no
					custom_tooltip = {
						text = build_imperial_road_mission_decision_modifier
						ROOT = { location = { holder_scope = { character = PREVPREVPREV } } }
					}
				}
			}
		}
		ai_check_interval = 16
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
			modifier = {
				factor = 10
				holder_scope = { character = FROM }
			}
			modifier = {
				factor = 5
				holder_scope = { is_friend = FROM }
			}
			modifier = {
				factor = 2
				holder_scope = { dynasty = FROM }
			}
		}
	}
	
	imperial_conquest_mission_decision = { #marshal
		is_in_society = yes
		diplomacy_icon = GFX_diplo_decision_icon
		
		filter = all
		ai_target_filter = all
		
		third_party = FROM
		third_party_filter = society
		ai_third_party_filter = society
		
		show_third_party_potential = yes
		
		from_potential = { 
			can_assign_imperial_court_missions_potential_trigger = yes 
			#to help performance
			OR = {
				ai = no
				is_imperial_court_marshal_trigger = yes
			}
		}
		third_party_potential = {
			FROMFROM = {
				show_scope_change = no
				can_be_assigned_ipc_mission_trigger = yes 
				OR = {
					ipc_has_education_martial_trigger = yes
					martial = 15
					hidden_tooltip = { ai = no }
				}
				higher_tier_than = count
				is_feudal = yes
			}
		}
		potential = {
			tier = duke
			is_titular = no
			holder_scope = { 
				NOR = { 
					same_realm = FROM 
					any_demesne_title = { temporary = yes }
					any_liege = { any_demesne_title = { temporary = yes } }
				}
			}
		}
		allow = {
			FROM = { 
				can_assign_marshal_missions_trigger = yes 
				society_currency >= 750
				can_interact_with_imperial_court_revolt_trigger = yes
				custom_tooltip = {
					text = imperial_conquest_mission_decision_allow2
					NOT = {
						society = {
							any_society_member = {
								has_quest = quest_ipc_imperial_conquest
							}
						}
					}
				}
			}
			ROOT = {
				trigger_if = {
					limit = { holder_scope = { independent = yes } }
					holder_scope = { show_scope_change = no higher_tier_than = duke }
				}
				trigger_else_if = {
					limit = { holder_scope = { independent = no } }
					holder_scope = { show_scope_change = no top_liege = { higher_tier_than = duke } }
				}
				custom_tooltip = {
					text = imperial_conquest_mission_decision_allow
					trigger_if = {
						limit = { holder_scope = { independent = yes } }
						holder_scope = {
							any_neighbor_independent_ruler = { 
								OR = {
									character = FROM
									is_liege_of = FROM
								}
							}
							any_realm_province = {
								de_jure_liege = ROOT
								any_neighbor_province = {
									holder_scope = {
										OR = {
											character = FROM
											is_liege_of = FROM
											FROM = { top_liege = { is_liege_or_above_of = PREVPREV } }
										}
									}
								}
							}
						}
					}
					trigger_else_if = {
						limit = { holder_scope = { independent = no } }
						holder_scope = {
							top_liege = {
								any_neighbor_independent_ruler = { 
									OR = {
										character = FROM
										is_liege_of = FROM
									}
								}
								any_realm_province = {
									de_jure_liege = ROOT
									any_neighbor_province = {
										holder_scope = {
											OR = {
												character = FROM
												is_liege_of = FROM
												FROM = { top_liege = { is_liege_or_above_of = PREVPREV } }
											}
										}
									}
								}
							}
						}
					}
				}
				
				trigger_if = {
					limit = { holder_scope = { independent = yes } }
					trigger_if = {
						limit = { FROM = { independent = yes } }
						holder_scope = { NOT = { has_non_aggression_pact_with = FROM } }
					}
					trigger_else_if = {
						limit = { FROM = { independent = no } }
						FROM = {
							show_scope_change = no
							top_liege = {
								show_scope_change = no
								ROOT = {
									show_scope_change = no
									holder_scope = {
										NOR = {
											has_non_aggression_pact_with = PREVPREV
											has_non_aggression_pact_with = PREVPREVPREV
										}
									}
								}
							}
						}
					}
				}
				trigger_else_if = {
					limit = { holder_scope = { independent = no } }
					trigger_if = {
						limit = { FROM = { independent = yes } }
						NOR = {
							holder_scope = { has_non_aggression_pact_with = FROM }
							holder_scope = {
								show_scope_change = no
								top_liege = { has_non_aggression_pact_with = FROM }
							}
						}
					}
					trigger_else_if = {
						limit = { FROM = { independent = no } }
						FROM = {
							show_scope_change = no
							top_liege = {
								show_scope_change = no
								ROOT = {
									show_scope_change = no
									NOR = {
										holder_scope = {
											OR = {
												has_non_aggression_pact_with = PREVPREV
												has_non_aggression_pact_with = PREVPREVPREV
											}
										}
										holder_scope = {
											show_scope_change = no
											top_liege = {
												OR = {
													has_non_aggression_pact_with = PREVPREVPREV
													has_non_aggression_pact_with = PREVPREVPREVPREV
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		effect = {
			FROM = { show_scope_change = no change_society_currency = -750 }
			custom_tooltip = {
				text = assigned_ipc_mission_effect
				ROOT = { save_event_target_as = imperial_conquest_target } #for quest UI and loc
				FROMFROM = {
					society = { save_persistent_event_target = { name = imperial_conquest_target scope = ROOT } }
					society_quest_event = { id = ipcq.230 } 
				}
			}
		}
		
		third_party_score = {
			factor = 10
			
			marshal_mission_candidate_score_value = yes
			additive_modifier = {
				value = 15
				FROMFROM = {
					show_scope_change = no
					tier = king
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					custom_tooltip = {
						text = imperial_conquest_mission_decision_modifier
						diplomacy = 8
						NOT = { diplomacy = 14 }
					}
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					custom_tooltip = {
						text = imperial_conquest_mission_decision_modifier2
						diplomacy = 14
						NOT = { diplomacy = 20 }
					}
				}
			}
			additive_modifier = {
				value = 15
				FROMFROM = {
					show_scope_change = no
					custom_tooltip = {
						text = imperial_conquest_mission_decision_modifier3
						diplomacy = 20
					}
				}
			}
			additive_modifier = {
				value = 5
				FROMFROM = {
					show_scope_change = no
					prestige = 500
				}
			}
			additive_modifier = {
				value = 10
				FROMFROM = {
					show_scope_change = no
					prestige = 1000
				}
			}
			additive_modifier = {
				value = 15
				FROMFROM = {
					show_scope_change = no
					prestige = 1500
				}
			}
			
		}
		ai_check_interval = 18
		ai_will_do = {
			factor = 0.3
			imperial_office_missions_ai_chance = yes
		}
	}
	
	
	
}




#society_decisions = {}















































