﻿namespace = 0s_outremer_borders

# FIX: Namespace IDs must follow 'namespace.number'
0s_outremer_borders.0001 = {
	type = character_event
	title = 0s_outremer_borders.0001.t
	desc = 0s_outremer_borders.0001.desc
	theme = realm
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = cp:councillor_court_chaplain
		animation = prayer
	}

	immediate = {
		play_music_cue = "mx_cue_epic_sacral_moment"
		0s_outremer_borders_scripted_effect = yes
		save_scope_as = restorer_king # Required for portraits
	}

	option = {
		name = 0s_outremer_borders.0001.a
		add_prestige = 500

		# Exact clone of middle_europe notification loop
		every_player = {
			limit = {
				this != root
				is_within_diplo_range = { CHARACTER = root }
			}
			trigger_event = 0s_outremer_borders.0002
		}
	}
}

# FIX: This event is now a unique recipient reaction
0s_outremer_borders.0002 = {
	type = character_event
	title = 0s_outremer_borders.0001.t # Clone uses decision title
	desc = {
		first_valid = {
			# Description logic based on if recipient is Catholic
			triggered_desc = {
				trigger = { faith = faith:catholic }
				desc = 0s_outremer_borders.0002.desc.catholic
			}
			triggered_desc = {
				trigger = { NOT = { faith = faith:catholic } }
				desc = 0s_outremer_borders.0002.desc.hostile
			}
		}
	}
	theme = realm
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:restorer_king
		animation = personality_bold
	}

	immediate = {
		# Music logic based on middle_europe
		if = {
			limit = { NOT = { faith = faith:catholic } }
			play_music_cue = "mx_cue_combat_2"
		}
	}

	option = {
		name = 0s_outremer_borders.0002.a
	}
}