﻿action_send_child_to_university = {
	priority = 355
	check_create_action = {
		if = {
			limit = {
				any_realm_province = {
					has_university_building_trigger = yes
					barony = {
						holder = {
							NOT = { this = root }
							is_adult = yes
							num_of_relation_ward < zz_ward_limit
							save_temporary_scope_as = vassal
						}
					}
				}
				any_child = {
					is_adult = no
					num_of_relation_guardian = 0
				}
			}
			try_create_important_action = {
				important_action_type = action_send_child_to_university
				actor = root
				recipient = scope:vassal
				secondary_recipient = scope:vassal
			}
		}
	}

	unimportant = {
		short_term_gold < monumental_gold_value
	}

	effect = {
		open_interaction_window = {
			interaction = offer_ward_interaction
			actor = scope:actor
			recipient = scope:recipient
			secondary_recipient = scope:secondary_recipient
		}
	}
}

action_send_guardian_to_university = {
	priority = 355
	check_create_action = {
		if = {
			limit = {
				any_realm_province = {
					has_university_building_trigger = yes
					barony = {
						holder = {
							NOT = { this = root }
							is_adult = no
							num_of_relation_guardian = 0
							save_temporary_scope_as = vassal
						}
					}
				}
				any_courtier = {
					is_adult = yes
					num_of_relation_ward < zz_ward_limit
				}
			}
			try_create_important_action = {
				important_action_type = action_send_guardian_to_university
				actor = root
				recipient = scope:vassal
				secondary_recipient = scope:vassal
			}
		}
	}

	unimportant = {
		short_term_gold < monumental_gold_value
	}

	effect = {
		open_interaction_window = {
			interaction = offer_guardianship_interaction
			actor = scope:actor
			recipient = scope:recipient
			secondary_recipient = scope:secondary_recipient
		}
	}
}


action_send_child_to_your_university = {
	priority = 355
	check_create_action = {
		if = {
			limit = {
				any_realm_province = {
					has_university_building_trigger = yes
					barony = {
						holder = {
							this = root
							num_of_relation_ward < zz_ward_limit
						}
					}
				}
				any_child = {
					is_adult = no
					num_of_relation_guardian = 0
				}
			}
			try_create_important_action = {
				important_action_type = action_send_child_to_your_university
				actor = root
				recipient = root
			}
		}
	}

	unimportant = {
		short_term_gold < monumental_gold_value
	}

	effect = {
		open_interaction_window = {
			interaction = educate_child_interaction
			actor = scope:actor
			recipient = scope:recipient
		}
	}
}


action_send_yourself_to_university = {
	priority = 355
	check_create_action = {
		if = {
			limit = {
				has_bp2_dlc_trigger = no # Old decision is redundant if you have BP2
				any_realm_province = {
					has_university_building_trigger = yes
					barony = {
						holder = {
							this = root
							is_adult = no
							num_of_relation_guardian = 0
						}
					}
				}
				any_courtier = {
					is_adult = yes
					num_of_relation_ward < zz_ward_limit
				}
			}
			try_create_important_action = {
				important_action_type = action_send_yourself_to_university
				actor = root
				recipient = root
			}
		}
	}

	unimportant = {
		short_term_gold < monumental_gold_value
	}

	effect = {
		open_interaction_window = {
			interaction = educate_child_interaction
			actor = scope:actor
			recipient = scope:recipient
		}
	}
}
