﻿aureliani_settle_italian_compact = {
	picture = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" }
	desc = aureliani_settle_italian_compact_desc
	selection_tooltip = aureliani_settle_italian_compact_tooltip
	decision_group_type = major
	ai_check_interval = 0
	is_shown = {
		is_playable_character = yes
		is_ruler = yes
		house = house:house_aureliani
		aureliani_foundation_completed_trigger = yes
		house = { NOT = { has_variable = aureliani_italian_compact } }
	}
	is_valid = {
		aureliani_compact_house_mandate_trigger = yes
		custom_description = { text = aureliani_prerequisite_tuscany_contact_tt aureliani_tuscany_completed_trigger = yes house = { has_variable = aureliani_italian_support } }
		has_title = title:d_toscana
		has_title = title:c_firenze
		completely_controls = title:d_toscana
		custom_description = { text = aureliani_compact_crown_ready_tt aureliani_compact_kingdom_relationship_trigger = yes }
		trigger_if = {
			limit = { NOT = { has_title = title:k_italy } }
			custom_description = { text = aureliani_compact_royal_cooldown_tt house = { NOT = { has_variable = aureliani_compact_petition_cooldown } } }
		}
		custom_description = { text = aureliani_compact_contact_tt house = { has_variable = aureliani_italian_support } }
		custom_description = { text = aureliani_compact_second_duchy_tt aureliani_compact_second_duchy_trigger = yes }
		custom_description = { text = aureliani_compact_idle_tt house = { NOR = { has_variable = aureliani_compact_owner has_variable = aureliani_italian_active_owner } } }
		custom_description = { text = aureliani_compact_vision_tt OR = { aureliani_civic_vision_trigger = yes aureliani_sacred_vision_trigger = yes aureliani_imperial_vision_trigger = yes } }
		aureliani_compact_route_ready_trigger = yes
	}
	effect = {
		if = {
			limit = { aureliani_compact_ready_trigger = yes NOR = { has_variable = aureliani_compact_owner has_variable = aureliani_italian_active_owner } }
			if = { limit = { NOT = { has_variable = aureliani_compact_serial } } set_variable = { name = aureliani_compact_serial value = 0 } }
		change_variable = { name = aureliani_compact_serial add = 1 }
		save_scope_value_as = { name = aureliani_compact_attempt value = var:aureliani_compact_serial }
		add_character_flag = aureliani_compact_pending
		set_variable = { name = aureliani_compact_stage value = 0 }
		if = {
			limit = { NOT = { has_title = title:k_italy } }
			set_variable = { name = aureliani_compact_king value = title:k_italy.holder }
		}
		house = { set_variable = { name = aureliani_compact_owner value = root } }
		if = { limit = { aureliani_civic_vision_trigger = yes } set_variable = { name = aureliani_compact_route value = 1 } }
		else_if = { limit = { aureliani_sacred_vision_trigger = yes } set_variable = { name = aureliani_compact_route value = 2 } }
		else = { set_variable = { name = aureliani_compact_route value = 3 } }
		custom_tooltip = aureliani_compact_expiry_tt
		trigger_event = aureliani.0070
		trigger_event = { id = aureliani.0079 days = 60 }
		}
	}
	ai_potential = { always = no }
}
