namespace = CM
# TODO: Convert to Plus namespace

# Prompting the AI to attack Lombardy
character_event = {
	id = CM.11081

	is_triggered_only = yes # on_yearly_pulse
	hide_window = yes

	only_independent = yes
	has_character_flag = is_charlemagne
	ai = yes
	war = no

	trigger = {
		has_strong_claim = k_lombardy
		has_global_flag = hre_formed
		is_inaccessible_trigger = no

		k_lombardy = {
			is_contested = no

			holder_scope = {
				reverse_realm_levy_diff = {
					who = ROOT
					value >= 5000
				}

				NOR = {
					character = ROOT
					same_realm = ROOT
					reverse_has_truce = ROOT
					is_allied_with = ROOT
					has_non_aggression_pact_with = ROOT
					is_married = ROOT
					pays_tribute_to = ROOT
					has_landed_title = k_papacy
					ROOT = { rightful_religious_head = PREV }
				}
			}
		}
	}

	immediate = {
		k_lombardy = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim
					thirdparty_title = PREV
					infamy = 0
				}
			}
		}
	}
}

# Prompting the AI to attack Saxony
character_event = {
	id = CM.11082

	is_triggered_only = yes # on_yearly_pulse
	hide_window = yes

	only_independent = yes
	ai = yes
	war = no

	trigger = {
		dynasty = 25061 # Karling
		has_strong_claim = k_saxony
		has_global_flag = hre_formed
		is_inaccessible_trigger = no

		k_saxony = {
			is_contested = no

			holder_scope = {
				reverse_realm_levy_diff = {
					who = ROOT
					value >= 5000
				}

				NOR = {
					character = ROOT
					same_realm = ROOT
					reverse_has_truce = ROOT
					is_allied_with = ROOT
					has_non_aggression_pact_with = ROOT
					is_married = ROOT
					pays_tribute_to = ROOT
					has_landed_title = k_papacy
					ROOT = { rightful_religious_head = PREV }
				}
			}
		}
	}

	immediate = {
		k_saxony = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim
					thirdparty_title = PREV
					infamy = 0
				}
			}
		}
	}
}