 namespace = WL_lv_zinara_project_events

###########################
###ZINARA TEMPLE
###########################

country_event = { # 3º B
	id = WL_lv_zinara_project_events.1
	hide_window = yes
	is_triggered_only = yes
  
	immediate = {
    country_event = { id = WL_lv_zinara_project_events.3 days = 30 }
	}
}

planet_event = { # Shrouded World
	id = WL_lv_zinara_project_events.2
	location = root
	hide_window = yes
	
	is_triggered_only = yes
  
	immediate = {
		THIS = { save_global_event_target_as = WL_lv_eternal_tomb_planet }
		enable_special_project = { 
			name ="WL_LV_TEMPLE_OF_ZINARA_1_PROJECT"
			location = this
			owner = from
		}
		save_global_event_target_as = WL_lv_eternal_tomb_planet
	}
}
		
country_event = { # Shrouded World Enable Project
	id = WL_lv_zinara_project_events.3
	title =  WL_lv_zinara_project_events.3.name
	desc = WL_lv_zinara_project_events.3.desc
	picture = GFX_evt_shrouded
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes
	
	option = {
		name =  WL_lv_zinara_project_events.3.a	
		random_planet = {
    	limit = {
				is_inside_border = FROM
				is_capital = no
   			OR = {
					is_planet_class = pc_molten
					is_planet_class = pc_toxic
					is_planet_class = pc_frozen
					is_planet_class = pc_broken
					is_planet_class = pc_shattered
					is_planet_class = pc_barren
					is_planet_class = pc_barren_cold
				}
				NOT = { exists = archaeological_site }
    	}
			enable_special_project = { 
				name ="WL_LV_TEMPLE_OF_ZINARA_1_PROJECT"
				location = this
				owner = from
			}
    }
	}
}
    
planet_event = { # Shrouded World Project Finish
	id = WL_lv_zinara_project_events.10
	title =  WL_lv_zinara_project_events.10.name
	desc = WL_lv_zinara_project_events.10.desc
	picture = GFX_evt_landing_ship
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes

	option = {
		name =  WL_lv_zinara_project_events.10.a	
		planet_event = { id = WL_LV_ancrel_zinara.10 days = 30 }
		change_planet_size = 20
		change_pc = pc_shrouded
		save_global_event_target_as = WL_lv_eternal_tomb_planet
	}
}
    	
######################################################
###HIDDEN EVENT - Zinara Spawn
######################################################
#DONE = X
#X TO DO: ZINARA make peace			 	-  
# Zinara - Stop Whoring - Xenophobe War
country_event = { 
	id = WL_lv_zinara_project_events.9000
	hide_window = yes
	is_triggered_only = yes
  
	immediate = {
		country_event = { id = WL_lv_Zinara_contact_events.6000}
		set_global_flag = ZINARA_spawned
		create_species = {
			name = "Zinara Aberrant"
			class = ZINARA
			plural = "Zinaras"
			namelist = "Extradimensional"
			portrait = exd4_zinara_fem_01
			traits = {
				trait = "trait_pc_nuked_preference"
				trait = "trait_lv_all_female"
				trait = "trait_lv_targeted_pheromones"
				trait = "trait_lv_elastic_orifices"
				trait = "trait_lv_exhibitionist"
				trait = "trait_lv_sexually_gifted"
				trait = "trait_lv_neuron_saliva"
				trait = "trait_lv_large_breasts"
				trait = "trait_lv_breeder_hips"
				trait = "trait_lv_excess_estrogen"
				trait = "trait_fertile"
				trait = "trait_robust"
				trait = "trait_erudite"
				trait = "trait_very_strong"
				trait = "trait_venerable"
				trait = "trait_psionic"
			}
			effect = { save_global_event_target_as = extradimensional_zinara_species }
		}
				
		create_country = {
			name = "Zinara Confluence"
			type = zinara_extradimensional
			species = event_target:extradimensional_zinara_species
			name_list = "Extradimensional"
			flag = {
				icon= {
					category="ornate"
					file="flag_ornate_23.dds"
				}
				background= {
					category = "backgrounds"
					file = "circle.dds"
				}
				colors={
					"burgundy"
					"pink"
					"null"
					"null"
				}
			}

			effect = {
				set_graphical_culture = extra_dimensional_01
				create_ship_design = { design = "NAME_Void_Shaper" }
				add_ship_design = last_created_design
				create_ship_design = { design = "NAME_Unbidden_Anchor" }
				add_ship_design = last_created_design
				#set_faction_hostility = {
				#	target = zinara_country_FROM
				#	target = FROM
				#	set_hostile = no
				#}
			
			set_country_flag = zinara
			save_global_event_target_as = zinara_country_target
			
			add_modifier = { modifier = WL_lv_zinara_bonus }
			}
		}

		event_target:zinara_country_target = {
			create_leader = {
				class = admiral
				species = event_target:extradimensional_zinara_species
				name = "Zinara Manifestation"
				skill = 10
				traits = {
					trait = leader_trait_admiral_psionic
					trait = leader_trait_ethereal
					trait = leader_trait_admiral_erudite
					trait = leader_trait_shroud_age
				}
			}

			create_fleet = {
				effect = {
					set_fleet_stance = aggressive
					set_owner = event_target:zinara_country_target
					create_ship = {
							name = "Zinara Manifestation"
							design = "Zinara Manifestation"
							upgradable = no
							graphical_culture = extra_dimensional_01
						}
					assign_leader = last_created_leader
					while = {
						count = 30
						create_ship = {
							name = random
							design = "NAME_Wraith"
							graphical_culture = "extra_dimensional_01"
						}
					}
					set_location = {
						target = event_target:WL_lv_eternal_tomb_planet
						distance = 5
						angle = random
					}
				}
			}
		}

		last_created_fleet = { 
			set_fleet_flag = zinara_manifestation_fleet
			save_global_event_target_as = zinara_fleet_02
		}

		every_country = { #Fire notif event
			limit = {
				OR = {
					is_country_type = default
					is_country_type = fallen_empire
					is_country_type = awakened_fallen_empire
				}
			}
			country_event = { id = WL_lv_Zinara_contact_events.1200 }
		}
		every_country = {
			establish_communications = event_target:zinara_country_target
		}
	}
}
	
#create first fleet	reinforcement
country_event = { 
	id = WL_lv_zinara_project_events.9001
	hide_window = yes
	is_triggered_only = yes
  
	immediate = {
		event_target:zinara_country_target = {
			create_leader = {
				class = admiral
				species = event_target:extradimensional_zinara_species
				name = "Zinara Manifestation"
				skill = 10
				traits = {
					trait = leader_trait_admiral_psionic
					trait = leader_trait_ethereal
					trait = leader_trait_admiral_erudite
					trait = leader_trait_shroud_age
				}
			}
			create_fleet = {
				name = "Zinara First Fleet"
				effect = {
					set_fleet_stance = aggressive
					set_owner = event_target:zinara_country_target
					create_ship = {
						name = random
						design = "NAME_Revenant"
						graphical_culture = "extra_dimensional_01"
					}
					assign_leader = last_created_leader
					while = {
						count = 11
						create_ship = {
							name = random
							design = "NAME_Revenant"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 25
						create_ship = {
							name = random
							design = "NAME_Phantom"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 50
						create_ship = {
							name = random
							design = "NAME_Wraith"
							graphical_culture = "extra_dimensional_01"
						}
					}
					set_location = {
						target = event_target:WL_lv_eternal_tomb_planet
						distance = 5
						angle = random
					}
				}
			}
		}
		last_created_fleet = { 
			set_fleet_flag = zinara_first_fleet
			save_global_event_target_as = zinara_fleet_01
		}
	}
}
	