﻿dlm_commission_ducal_landmark_decision = {
	picture = {
		reference = gfx/interface/illustrations/decisions/decision_legend.dds
	}
	decision_group_type = major
	selection_tooltip = dlm_commission_ducal_landmark_decision_selection_tooltip

	widget = {
		controller = create_holy_order
		barony_valid = {
			trigger_if = {
				limit = { exists = this }
				is_capital_barony = yes
				this.county = {
					holder = scope:ruler
					title_province = {
						dlm_is_commissionable_landmark_site = yes
					}
				}
			}
		}
	}

	is_shown = {
		is_landed = yes
	}

		is_valid = {
			dlm_can_commission_ducal_landmark = yes
		trigger_if = {
			limit = { exists = scope:barony }
			scope:barony = {
				is_capital_barony = yes
				county = {
					holder = root
					title_province = {
						dlm_is_commissionable_landmark_site = yes
					}
				}
			}
		}
	}

	effect = {
		if = {
			limit = { exists = scope:barony }
			scope:barony ?= {
				save_scope_as = dlm_target_barony
			}
			scope:barony.county ?= {
				save_scope_as = dlm_target_county
			}
		}
		trigger_event = dlm_ducal_landmarks.000201
	}

	ai_potential = { always = no }
	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 0
		kingdom = 0
		empire = 0
		hegemony = 0
	}
}

dlm_dismantle_ducal_landmark_decision = {
	picture = {
		reference = gfx/interface/illustrations/decisions/decision_legend.dds
	}
	selection_tooltip = dlm_dismantle_ducal_landmark_decision_selection_tooltip

	widget = {
		controller = create_holy_order
		barony_valid = {
			trigger_if = {
				limit = { exists = this }
				is_capital_barony = yes
				this.county = {
					holder = scope:ruler
					title_province = {
						has_special_building = yes
						dlm_is_supported_dismantle_target = yes
					}
				}
			}
		}
	}

	is_shown = {
		is_landed = yes
		any_sub_realm_county = {
			holder = root
			title_province = {
				has_special_building = yes
				dlm_is_supported_dismantle_target = yes
			}
		}
	}

	is_valid = {
		custom_tooltip = {
			text = dlm_dismantle_ducal_landmark_decision_discount_ready_tt
			AND = {
				NOT = { has_variable = dlm_next_commission_discount_active }
				OR = {
					NOT = { exists = primary_title }
					NOT = { primary_title = { has_variable = dlm_next_commission_discount_active } }
				}
			}
		}
		custom_tooltip = {
			text = dlm_dismantle_ducal_landmark_decision_cooldown_tt
			NOT = { has_character_modifier = dlm_recent_landmark_dismantle_cooldown }
		}
		custom_tooltip = {
			text = dlm_dismantle_ducal_landmark_decision_target_tt
			OR = {
				any_sub_realm_county = {
					holder = root
					title_province = {
						has_special_building = yes
						dlm_is_supported_dismantle_target = yes
					}
				}
				trigger_if = {
					limit = { exists = scope:barony }
					scope:barony = {
						is_capital_barony = yes
						county = {
							holder = root
							title_province = {
								has_special_building = yes
								dlm_is_supported_dismantle_target = yes
							}
						}
					}
				}
			}
		}
	}

	effect = {
		if = {
			limit = { exists = scope:barony }
			scope:barony ?= {
				save_scope_as = dlm_target_barony
			}
			scope:barony.county ?= {
				save_scope_as = dlm_target_county
			}
		}
		dlm_dismantle_landmark_effect = yes
		trigger_event = dlm_ducal_landmarks.0003
	}

	ai_potential = { always = no }
	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 0
		kingdom = 0
		empire = 0
		hegemony = 0
	}
}

dlm_invite_spies_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_recruitment.dds"
	}
	desc = dlm_invite_spies_decision_desc
	decision_group_type = courtier
	cooldown = { years = 5 }

	is_shown = {
		is_landed = yes
		any_sub_realm_county = {
			holder = root
			title_province = {
				OR = {
					has_building = dlm_dread_fort_01
					has_building = dlm_dread_fort_02
					has_building = dlm_dread_fort_03
					has_building = dlm_dread_fort_04
					has_building = dlm_dread_fort_r_01
					has_building = dlm_dread_fort_r_02
					has_building = dlm_dread_fort_r_03
					has_building = dlm_dread_fort_r_04
					has_building = dlm_dread_fort_l_01
					has_building = dlm_dread_fort_l_02
					has_building = dlm_dread_fort_l_03
					has_building = dlm_dread_fort_l_04
				}
			}
		}
	}

	is_valid = {
		custom_tooltip = {
			text = dlm_invite_spies_decision_target_tt
			any_sub_realm_county = {
				holder = root
				title_province = {
					OR = {
						has_building = dlm_dread_fort_01
						has_building = dlm_dread_fort_02
						has_building = dlm_dread_fort_03
						has_building = dlm_dread_fort_04
						has_building = dlm_dread_fort_r_01
						has_building = dlm_dread_fort_r_02
						has_building = dlm_dread_fort_r_03
						has_building = dlm_dread_fort_r_04
						has_building = dlm_dread_fort_l_01
						has_building = dlm_dread_fort_l_02
						has_building = dlm_dread_fort_l_03
						has_building = dlm_dread_fort_l_04
					}
				}
			}
		}
	}

	effect = {
		set_variable = {
			name = number_of_invite_spies_countdown
			value = 1
			days = 1000
		}
		if = {
			limit = {
				any_sub_realm_county = {
					holder = root
					title_province = {
						OR = {
							has_building = dlm_dread_fort_r_01
							has_building = dlm_dread_fort_r_02
							has_building = dlm_dread_fort_r_03
							has_building = dlm_dread_fort_r_04
							has_building = dlm_dread_fort_l_01
							has_building = dlm_dread_fort_l_02
							has_building = dlm_dread_fort_l_03
							has_building = dlm_dread_fort_l_04
						}
					}
				}
			}
			change_variable = {
				name = number_of_invite_spies_countdown
				add = 1
			}
		}
		if = {
			limit = {
				any_sub_realm_county = {
					holder = root
					title_province = {
						OR = {
							has_building = dlm_dread_fort_l_01
							has_building = dlm_dread_fort_l_02
							has_building = dlm_dread_fort_l_03
							has_building = dlm_dread_fort_l_04
						}
					}
				}
			}
			change_variable = {
				name = number_of_invite_spies_countdown
				add = 1
			}
		}
		trigger_event = {
			id = dlm_ducal_landmarks.0090
			days = { 20 40 }
		}
		custom_tooltip = dlm_invite_spies_decision_effect_tt
	}

	cost = {
		prestige = {
			value = 150
		}
	}

	ai_potential = { always = no }
	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 0
		kingdom = 0
		empire = 0
		hegemony = 0
	}
	ai_will_do = { base = 0 }
}

# Replaced by activity_dlm_colosseum so the launcher appears in Hosted Events.
