namespace = everpreg_giant_cecaelias_event

##Summon Giant Cecaelias
everpreg_giant_cecaelias_event.001 = { #by Mathilda Bjarnehed
	type = character_event
	title = everpreg_giant_cecaelias
	desc = everpreg_giant_cecaelias.001.desc
	theme = dynasty
	left_portrait = {
		character = root
		animation = personality_bold
	}
	
	immediate = {
		play_music_cue = "mx_cue_positive_effect"
		everpreg_giant_cecaelias_effects = yes
		spawn_everpreg_giant_cecaelias_troops_effect = yes
		#For desc
		hidden_effect = {
			primary_title = { save_scope_as = realm_1 }

			dynasty = {
				every_dynasty_member = {
					limit = {
						NOT = { this = root }
						is_independent_ruler = yes
						highest_held_title_tier >= tier_kingdom
					}
					primary_title = { add_to_list = dynasty_realms }
				}
			}

			random_in_list = {
				list = dynasty_realms
				limit = { tier = tier_empire }
				alternative_limit = { always = yes }
				save_scope_as = realm_2
			}

			random_in_list = {
				list = dynasty_realms
				limit = {
					tier = tier_empire
					NOT = { this = scope:realm_2 }
				}
				alternative_limit = {
					NOT = { this = scope:realm_2 }
				}
				save_scope_as = realm_3
			}

			random_in_list = {
				list = dynasty_realms
				limit = {
					tier = tier_empire
					NOR = {
						this = scope:realm_2
						this = scope:realm_3
					}
				}
				alternative_limit = {
					NOR = {
						this = scope:realm_2
						this = scope:realm_3
					}
				}
				save_scope_as = realm_4
			}
		}
	}

	option = {
		name = everpreg_giant_cecaelias.001.a
	}
}

