namespace = WL_lv_Zinara_contact_events

country_event = {
	id = WL_lv_Zinara_contact_events.1
	title = "Zinara"
	show_sound = event_whispering

	is_triggered_only = yes 
	desc = {
		text = WL_lv_Zinara_contact_events.1.desc_01
		trigger = {
			exists = event_target:zinara_country_target
			event_target:zinara_country_target = {
				NOT = { is_hostile = root }
			}
			NOT = { owner_species = { has_trait = trait_psionic } }
		}
	}
	desc = {
		text = WL_lv_Zinara_contact_events.1.desc_02
		trigger = {
			exists = event_target:zinara_country_target
			event_target:zinara_country_target = {
				NOT = { is_hostile = root }
			}
			owner_species = { has_trait = trait_psionic }
		}
	}
	desc = {
		text = WL_lv_Zinara_contact_events.1.desc_03
		trigger = {
			exists = event_target:zinara_country_target
			event_target:zinara_country_target = {
				NOT = { is_hostile = root }
			}
			OR = {
				owner_species = { has_trait = trait_mechanical }
				has_authority = auth_machine_intelligence
			}
		}
	}
	desc = {
		text = WL_lv_Zinara_contact_events.1.desc_04
		trigger = {
			exists = event_target:zinara_country_target
			event_target:zinara_country_target = {
				is_hostile = root
			}
		}
	}

	diplomatic = yes
	force_open = yes
	
	picture_event_data = {
		portrait = event_target:zinara_country_target
		room = "extradimensional_room"
	}
	
	trigger = {
		exists = event_target:zinara_country_target
		NOT = { has_country_flag = zinara_rival}
	}
	
	immediate = {
		random_country = {
			limit = { is_country_type = zinara_extradimensional }
			save_event_target_as = zinara_country_target
		}
	}

	option = { #Nevermind Nothing
		name = WL_lv_Zinara_contact_events.1.z 
		response_text = WL_lv_Zinara_contact_events.1.z.response
		
		hidden_effect = { remove_modifier = relic_activation_cooldown }
	}
	
	######
	######
	######
	
	option = { #PEACE for PAY A NEW FLEET
		name = WL_lv_Zinara_contact_events.1.x
		response_text = WL_lv_Zinara_contact_events.1.x.response	
			allow = {
				resource_stockpile_compare = { resource = energy value >= 25000 }
				event_target:zinara_country_target = { is_hostile = root }
			}
		hidden_effect = {
			this = {
			add_resource = { energy = -25000 }
			}
			country_event = { id = WL_lv_Zinara_contact_events.3010 days = 30}
			event_target:zinara_country_target = {
				set_faction_hostility = {
					target = FROM
					set_hostile = no
				}
			}
		}
	}
	
	option = { #PEACE for organic GIVE POPS	50
		name = WL_lv_Zinara_contact_events.1.y
		response_text = WL_lv_Zinara_contact_events.1.y.response	
		allow = {
			any_owned_planet  = {
				count_owned_pop_amount = { 
					limit = {
							is_enslaved = no
							is_being_purged = no
						NOR = {
							has_trait = trait_machine_unit
							has_trait = trait_mechanical
							is_robot_pop = yes
						} 
					} 
					count > 6400
				}
			}
			event_target:zinara_country_target = { is_hostile = root }
			NOR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}
		hidden_effect = {
			country_event = { id = WL_lv_Zinara_tribute_events.5301}
			country_event = { id = WL_lv_Zinara_contact_events.1201 days = 12}
		}
	}
	
##################
##ZINARA DIPLO oferta de paz ADD HERE
##################

	option = { #PEACE for organic GIVE POPS	50  MACHINE
		name = WL_lv_Zinara_contact_events.1.t
		response_text = WL_lv_Zinara_contact_events.1.t.response	
		allow = {
			This = {
				any_owned_planet  = {
					count_owned_pop_amount = {
						limit = {
							is_enslaved = no
							is_being_purged = no
							OR = {
								has_trait = trait_machine_unit
								has_trait = trait_mechanical
								is_robot_pop = yes
							} 
						} 
						count > 6400
					}
				}
			}
			event_target:zinara_country_target = { is_hostile = root }
			OR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}
		hidden_effect = {
			country_event = { id = WL_lv_Zinara_tribute_events.5301}
			country_event = { id = WL_lv_Zinara_contact_events.1201 days = 12}
		}
	}
	
	option = { #Ask for Pop grow speed x 10 pops - 5old
		name = WL_lv_Zinara_contact_events.1.b
		response_text = WL_lv_Zinara_contact_events.1.b.response

		allow  = {
			This = {
				any_owned_planet  = {
					count_owned_pop_amount = { 
						limit = {
							is_enslaved = no
							is_being_purged = no
							NOR = {
								has_trait = trait_machine_unit
								has_trait = trait_mechanical
								is_robot_pop = yes
							} 
						} 
						count > 24
					}
				}
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
			NOR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}	
		
		hidden_effect = {
				country_event = { id = WL_lv_Zinara_notification_tribute_events.1 days = 12}
				country_event = { id = WL_lv_Zinara_tribute_events.5100 }
		}
	}
	
	option = { #Ask for Extradimensional Ships x 50 pops - 15old
		name = WL_lv_Zinara_contact_events.1.c
		response_text = WL_lv_Zinara_contact_events.1.c.response
		
		allow  = {
			resource_stockpile_compare = { resource = energy value >= 1200 }
			This = {
				any_owned_planet  = {
					num_pops > 64
				}
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
		}	
		
		hidden_effect = {
			country_event = { id = WL_lv_Zinara_notification_tribute_events.5 days = 12}
			country_event = { id = WL_lv_Zinara_tribute_events.5301}
			this = { add_resource = { energy = -1200 } }
		}
	}

	option = { #Ask for Zinara spectre POP x 120 pops
		name = WL_lv_Zinara_contact_events.1.d 
		response_text = WL_lv_Zinara_contact_events.1.d.response
		
		allow = {
			This = {
				any_owned_planet  = {
					count_owned_pop_amount = {
						limit = {
							is_enslaved = no
							is_being_purged = no
							NOR = {
								has_trait = trait_machine_unit
								has_trait = trait_mechanical
								is_robot_pop = yes
							} 
						} 
						count > 12900
					}
				}
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
			NOR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}
		
		hidden_effect = {
			country_event = { id = WL_lv_Zinara_notification_tribute_events.7 days = 12}
			country_event = { id = WL_lv_Zinara_tribute_events.5101}
		}
	}
	
	option = { #Ask for army 25p - 10 old
		name = WL_lv_Zinara_contact_events.1.e
		response_text = WL_lv_Zinara_contact_events.1.e.response
		
		allow  = {
			This = {
				any_owned_planet  = {
					num_pops > 34
				}	
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
		}

		hidden_effect = {
			country_event = { id = WL_lv_Zinara_notification_tribute_events.6 days = 12}
			country_event = { id = WL_lv_Zinara_tribute_events.5300}
		}
	}
	
	option = { #Ask for Zinara leader x 25 pops
		name = WL_lv_Zinara_contact_events.1.f
		response_text = WL_lv_Zinara_contact_events.1.f.response
		
		allow  = {
			This = {
				any_owned_planet  = {
					num_pops > 34
				}	
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
		}

		hidden_effect = {
			country_event = { id = WL_lv_Zinara_notification_tribute_events.3 days = 12}
			country_event = { id = WL_lv_Zinara_tribute_events.5300}
		}
	}
	
	option = { #Ask for Zinara ruler x 25 pops
		name = WL_lv_Zinara_contact_events.1.g
		response_text = WL_lv_Zinara_contact_events.1.g.response
		
		allow  = {
			This = {
				any_owned_planet  = {
					num_pops > 34
				}	
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
			OR = {
				owner_species = { has_trait = trait_psionic }
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}	
		
		hidden_effect = {
			country_event = { id = WL_lv_Zinara_notification_tribute_events.4 days = 12 }
			country_event = { id = WL_lv_Zinara_tribute_events.5300}
		}
	}
	option = { #Ask for Zinara energy conductor - pop build 10
		name = WL_lv_Zinara_contact_events.1.h
		response_text = WL_lv_Zinara_contact_events.1.h.response
		
		allow  = {
			This = {
				any_owned_planet  = {
					count_owned_pop_amount = {
						limit = {
							is_enslaved = no
							is_being_purged = no
							OR = {
								has_trait = trait_machine_unit
								has_trait = trait_mechanical
								is_robot_pop = yes
							} 
						} 
						count	> 2400
					}
				}
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
			OR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}	

		hidden_effect = {
			country_event = { id = WL_lv_Zinara_notification_tribute_events.2 days = 12}
			country_event = { id = WL_lv_Zinara_tribute_events.5201}
		}
	}
}

################################
################################
################################
# Generic Zinara diplo
country_event = {
	id = WL_lv_Zinara_contact_events.1040
	title = "TRANSMISSION"
	show_sound = event_whispering
	
	desc = {
		text = WL_lv_Zinara_contact_events.1040.desc_01
		trigger = {
			from = { is_country_type = zinara_extradimensional }
		}
	}

	diplomatic = yes
	is_triggered_only = yes

	picture_event_data = {
		portrait = event_target:zinara_country_target
		room = "extradimensional_room"
	}
	
	trigger = {
		This = { 
			NOT = { has_country_flag =  zinara_rival}
		}
		FROM = {
			is_country_type = zinara_extradimensional
		}
		event_target:zinara_country_target = {
			is_hostile = root
		}
	}

	immediate = {
		random_country = {
			limit = { is_country_type = zinara_extradimensional }
			save_event_target_as = zinara_country_target
		}
	}

	option = { #Nevermind Nothing
		name = WL_lv_Zinara_contact_events.1040.a 
		response_text = WL_lv_Zinara_contact_events.1040.a.response
	}
	
	option = { #PEACE for organic GIVE POPS	 
		name = WL_lv_Zinara_contact_events.1040.b
		response_text = WL_lv_Zinara_contact_events.1040.b.response	
		allow = {
			This = {
				any_owned_planet  = {
					count_owned_pop_amount = { 
						limit = {
							is_enslaved = no
							is_being_purged = no
							NOR = {
								has_trait = trait_machine_unit
								has_trait = trait_mechanical
								is_robot_pop = yes
							} 
						} 
						count > 3400
					}
				}
			}
			event_target:zinara_country_target = { is_hostile = root }
			NOR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}

		hidden_effect = {
			country_event = { id = WL_lv_Zinara_tribute_events.5000}
			country_event = { id = WL_lv_Zinara_contact_events.1201 days = 12}
		}
	}
	
	option = { #PEACE for machine GIVE POPS	 
		name = WL_lv_Zinara_contact_events.1040.c
		response_text = WL_lv_Zinara_contact_events.1040.c.response

		allow = {
			This = {
				any_owned_planet  = {
					count_owned_pop_amount = { 
						limit = {
							is_enslaved = no
							is_being_purged = no
							OR = {
								has_trait = trait_machine_unit
								has_trait = trait_mechanical
								is_robot_pop = yes
							} 
						}
						count > 3400
					}
				}
			}
			event_target:zinara_country_target = { is_hostile = root }
			OR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}

		hidden_effect = {
			country_event = { id = WL_lv_Zinara_tribute_events.5200}
			country_event = { id = WL_lv_Zinara_contact_events.1201 days = 12}
		}
	}
	
	option = { #PEACE for PAY A NEW FLEET
		name = WL_lv_Zinara_contact_events.1.x
		response_text = WL_lv_Zinara_contact_events.1.x.response

		allow = {
			resource_stockpile_compare = { resource = energy value >= 25000 }
			event_target:zinara_country_target = { is_hostile = root }
		}

		hidden_effect = {
			this = { add_resource = { energy = -25000 } }
			country_event = { id = WL_lv_Zinara_contact_events.1201 days = 12}
			country_event = { id = WL_lv_Zinara_contact_events.3010 days = 30}
		}
	}
}

################################
################################
#################################

country_event = {
	id = WL_lv_Zinara_contact_events.1050
	title = "TRANSMISSION"
	show_sound = event_whispering

	picture_event_data = {
		portrait = event_target:zinara_country_target
		room = "extradimensional_room"
	}
	
	desc = {
		text = WL_lv_Zinara_contact_events.1050.desc_01
		trigger = {
			NOR = { owner_species = { has_trait = trait_psionic has_trait = trait_mechanical } has_authority = auth_machine_intelligence }
		}
	}
	desc = {
		text = WL_lv_Zinara_contact_events.1050.desc_02
		trigger = {
			NOT = { owner_species = { has_trait = trait_psionic } }
		}
	}
	desc = {
		text = WL_lv_Zinara_contact_events.1050.desc_05
		trigger = {
			owner_species = { has_trait = trait_psionic }
		}
	}
	desc = {
		text = WL_lv_Zinara_contact_events.1050.desc_06
		trigger = {
			owner_species = { has_trait = trait_hive_mind }
		}
	}
	desc = {
		text = WL_lv_Zinara_contact_events.1050.desc_07
		trigger = {
			OR = {
				owner_species = { has_trait = trait_mechanical }
				has_authority = auth_machine_intelligence
			}
		}
	}

	diplomatic = yes
	force_open = yes
	is_triggered_only = yes

	trigger = {
		This = { 
			NOT = { has_country_flag =  zinara_rival }
		}
		FROM = {
			is_country_type = zinara_extradimensional
		}
		event_target:zinara_country_target = {
			NOT = { is_hostile = root }
		}
	}

	option = { #nevermind
		name = WL_lv_Zinara_contact_events.1050.y
		response_text = WL_lv_Zinara_contact_events.1050.y.response
	}
	
	option = { #who
		name = WL_lv_Zinara_contact_events.1050.z 
		response_text = WL_lv_Zinara_contact_events.1050.z.response
	}
	
	option = { #what
		name = WL_lv_Zinara_contact_events.1050.x
		response_text = WL_lv_Zinara_contact_events.1050.x.response
	}
	
#	option = { #random blessing
#		name = WL_lv_Zinara_contact_events.1050.v
#		response_text = WL_lv_Zinara_contact_events.1050.v.response
#	}
	
	
	option = { #JOIN WARS
		name = WL_lv_Zinara_contact_events.1050.w
		response_text = WL_lv_Zinara_contact_events.1050.w.response
		
		allow = {
			any_owned_planet  = {
				count_owned_pop_amount = { 
					limit = {
						is_enslaved = no
						is_being_purged = no
						NOR = {
							has_trait = trait_machine_unit
							has_trait = trait_mechanical
							is_robot_pop = yes
						} 
					} 
				count > 2900
				}
			}
			this = {
				is_at_war = yes
				is_war_leader = yes
			}
			event_target:zinara_country_target = { NOT = { is_hostile = root } }
		}
		
#		hidden_effect = {
#			event_target:zinara_country_target = { 
#					join_war = root
#			}
#			country_event = { id = WL_lv_Zinara_contact_events.3005 }
#		}
	}
	
	option = {
		name = WL_lv_Zinara_contact_events.1050.a
		response_text = WL_lv_Zinara_contact_events.1050.a.response
		trigger = {
			NOR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}
	}
	
	option = {
		name = WL_lv_Zinara_contact_events.1050.b
		trigger = {
			OR = {
				has_ethic = "ethic_pacifist"
				has_ethic = "ethic_fanatic_pacifist"
			}
		}
		response_text = WL_lv_Zinara_contact_events.1050.b.response
	}

	option = {
		name = WL_lv_Zinara_contact_events.1050.c
		trigger = {
			OR = {
				has_ethic = "ethic_militarist"
				has_ethic = "ethic_fanatic_militarist"
			}
		}
		response_text = WL_lv_Zinara_contact_events.1050.c.response
	}

	option = {
		name = WL_lv_Zinara_contact_events.1050.d
		trigger = {
			OR = {
				has_ethic = "ethic_xenophobe"
				has_ethic = "ethic_fanatic_xenophobe"
			}
		}
		response_text = WL_lv_Zinara_contact_events.1050.d.response
	}

	option = {
		name = WL_lv_Zinara_contact_events.1050.e
		trigger = {
			OR = {
				has_ethic = "ethic_xenophile"
				has_ethic = "ethic_fanatic_xenophile"
			}
			NOT = { owner_species = { has_trait = trait_mechanical } }
		}
		response_text = WL_lv_Zinara_contact_events.1050.e.response
	}

	option = {
		name = WL_lv_Zinara_contact_events.1050.f
		trigger = {
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
			NOT = { owner_species = { has_trait = trait_psionic } }
		}
		response_text = WL_lv_Zinara_contact_events.1050.f.response
	}

	option = {
		name = WL_lv_Zinara_contact_events.1050.g
		trigger = {
			owner_species = { has_trait = trait_psionic }
		}
		response_text = WL_lv_Zinara_contact_events.1050.g.response
	}

	option = {
		name = WL_lv_Zinara_contact_events.1050.h
		response_text = WL_lv_Zinara_contact_events.1050.h.response
		trigger = {
			OR = {
				has_authority = auth_machine_intelligence
				owner_species = { has_trait = trait_mechanical }
			}
		}
	}

	option = {
		name = WL_lv_Zinara_contact_events.1050.i
		trigger = {
			owner_species = { has_trait = trait_hive_mind }
		}
		response_text = WL_lv_Zinara_contact_events.1050.i.response
	}
}

#############################
#############################
#############################
#COMMUNICATION GLOBAL

country_event = {
	id = WL_lv_Zinara_contact_events.1200
	title =  WL_lv_Zinara_contact_events.1200.name
	desc = WL_lv_Zinara_contact_events.1200.desc
	picture = GFX_evt_WL_lv_Zinara_contact_events_1200
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes
	
	immediate = {
		event_target:WL_lv_eternal_tomb_planet = { 
			remove_modifier = WL_lv_strange_energy_site_planet
			set_planet_size = 20
		}
		establish_communications = event_target:zinara_country_target
	}

	option = {
		name = WL_lv_Zinara_contact_events.1200.a
	}
}
#############################
#PEACE

country_event = {
	id = WL_lv_Zinara_contact_events.1201
	title =  WL_lv_Zinara_contact_events.1201.name
	desc = WL_lv_Zinara_contact_events.1201.desc
	picture = GFX_evt_WL_lv_Zinara_contact_events_1201
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes
	
	
	immediate = {
		hidden_effect = {
			event_target:zinara_country_target = {
				set_faction_hostility = {
					target = FROM
					set_hostile = no
				}
			}
		}
	}

	option = {
		name = WL_lv_Zinara_contact_events.1201.a
	}
}

##########################################################
#FLEET DESTROYED REGEN AND PERMANENT HOSTILE
##########################################################

#############################
##Regen Zinara Manifestation
#############################
country_event = {
	id = WL_lv_Zinara_contact_events.3000
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		is_country_type = zinara_extradimensional
		FromFrom = {
			has_fleet_flag = zinara_manifestation_fleet
			NOR  = {
					has_fleet_flag = zinara_manifestation_fleet_less_power
				}
			}
		From = { NOT = { has_country_flag = zinara_contender }}	
	}

	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 Manifestation"
				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 = 20
						create_ship = {
							name = random
							design = "NAME_Revenant"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 40
						create_ship = {
							name = random
							design = "NAME_Phantom"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 120
						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
			set_fleet_flag = zinara_manifestation_fleet_less_power
			save_global_event_target_as = zinara_fleet_02
		}

		every_playable_country = {
			limit = {
				exists = event_target:zinara_country_target
				has_communications = event_target:zinara_country_target
			}
			country_event = { id = WL_lv_Zinara_contact_events.3004 days = 5 }
		}
	}
}

#############################
##Regen main fleet
#############################

country_event = {
	id = WL_lv_Zinara_contact_events.4000
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		is_country_type = zinara_extradimensional
		FromFrom = {
			has_fleet_flag = zinara_first_fleet
			has_fleet_flag = THISISFORNOTREGENERATETHEFLEET
		}
		From = { NOT = { has_country_flag = zinara_contender }}		
	}

	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 = {
				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 = 90
						create_ship = {
							name = random
							design = "NAME_Revenant"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 120
						create_ship = {
							name = random
							design = "NAME_Phantom"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 140
						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
		}

		every_playable_country = {
			limit = {
				exists = event_target:zinara_country_target
				has_communications = event_target:zinara_country_target
			}
			country_event = { id = WL_lv_Zinara_contact_events.3004 days = 5 }
		}
	}
}


#############################
##for agressor - set rival and notify the regen
#############################

country_event = {
	id = WL_lv_Zinara_contact_events.3001
	title =  WL_lv_Zinara_contact_events.3001.name
	desc = WL_lv_Zinara_contact_events.3001.desc
	picture = GFX_evt_WL_lv_Zinara_contact_events_rival
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes
	
	trigger = {
		From = {  is_country_type = zinara_extradimensional	}
		FromFromFrom = { has_fleet_flag = zinara_manifestation_fleet	}	
		This = { 
			NOR = { 
				has_country_flag = zinara_contender 
				has_country_flag = zinara_rival 
			}
		}
	}
	
	immediate = {
		This = {  
			set_faction_hostility = {
				target = event_target:zinara_country_target
				set_hostile = yes
			}
		}
		This = {
			set_country_flag = zinara_rival
			add_modifier = {
				modifier = "WL_lv_zinara_rival_country" 
				days = -1
			}
		}	
	}	
	option = {
		name = WL_lv_Zinara_contact_events.3001.a
	}
}



##########################################################
#for agressor - destroy zinara manifestation succesful
##########################################################
#destroy zinara manifestation will init the sealing project
#other player can liberate zinara if 
#conquer the system of the sealed planet
#old sealed planet explodes
#
##########################################################

event = {
	id = WL_lv_Zinara_contact_events.3011
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		From = {  is_country_type = zinara_extradimensional}
		FromFromFrom = { has_fleet_flag = zinara_manifestation_fleet}	
		This = { has_country_flag = zinara_contender }	
	}
	
	immediate = {
		every_country = {
			country_event = { id = WL_lv_Zinara_contact_events.3013 }
		}
		This = { 
			set_country_flag = zinara_destroyer
		}	
	}
}

##########################################################
#other countries - country destroyed zinara manifestation succesful
##########################################################

country_event = {
	id = WL_lv_Zinara_contact_events.3013
	title =  WL_lv_Zinara_contact_events.3013.name
	desc = WL_lv_Zinara_contact_events.3013.desc
	picture = GFX_evt_WL_lv_Zinara_contact_events_rival
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes
	
	trigger =	{
		NOR = { 
			has_country_flag = zinara_contender
			has_country_flag = zinara_rival
		}
	}

	option = {
		name = WL_lv_Zinara_contact_events.3012.a
	}
}

##########################################################
#reinforcement notification
##########################################################

country_event = {
	id = WL_lv_Zinara_contact_events.3004
	title =  WL_lv_Zinara_contact_events.3004.name
	desc = WL_lv_Zinara_contact_events.3004.desc
	picture = GFX_evt_WL_lv_Zinara_contact_events_rival
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes
	
	trigger =	{
		OR = { 
			has_country_flag = zinara_informed_reinforcement 
			has_country_flag = zinara_rival
			has_country_flag = zinara_contender
		}
	}
		
	immediate = {
		set_country_flag = zinara_informed_reinforcement
	}

	option = {
		name = WL_lv_Zinara_contact_events.3004.a
	}
}

##########################################################
##Join war
##########################################################

country_event = {
	id = WL_lv_Zinara_contact_events.3005
	title =  WL_lv_Zinara_contact_events.3005.name
	desc = WL_lv_Zinara_contact_events.3005.desc
	picture = GFX_evt_WL_lv_Zinara_contact_events_1201
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes

	option = {
		name = WL_lv_Zinara_contact_events.3005.a
	}
}


##########################################################
#rival notification relic
##########################################################

country_event = {
	id = WL_lv_Zinara_contact_events.100
	title =  WL_lv_Zinara_contact_events.100.name
	desc = WL_lv_Zinara_contact_events.100.desc
	picture = GFX_evt_WL_lv_Zinara_contact_events_rival
	show_sound = event_whispering
	hide_window = no
	is_triggered_only = yes
	
	trigger = {
		has_country_flag = zinara_rival
	}

	option = {
		name = WL_lv_Zinara_contact_events.100.a
	}
}
##########################################################
#Zinara new fleet
##########################################################
country_event = {
	id = WL_lv_Zinara_contact_events.3010
	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 = {
				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 = 4
						create_ship = {
							name = random
							design = "NAME_Revenant"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 10
						create_ship = {
							name = random
							design = "NAME_Phantom"
							graphical_culture = "extra_dimensional_01"
						}
					}
					while = {
						count = 60
						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
					}
				}
			}
		}
	}
}

##########################################################
#Zinara new Mothership
##########################################################
country_event = {
	id = WL_lv_Zinara_contact_events.3111
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		is_country_type = zinara_extradimensional
		FromFrom = {
			has_fleet_flag = zinara_first_fleet
			has_fleet_flag = zinara_manifestation_fleet_less_power
		}
		From = { NOT = { has_country_flag = zinara_contender }}		
	}

	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 Manifestation"
				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
				}
			}
		}

		last_created_fleet = { 
			set_fleet_flag = zinara_manifestation_fleet
			set_fleet_flag = zinara_manifestation_fleet_less_power
			save_global_event_target_as = zinara_fleet_02
		}

		every_playable_country = {
			limit = {
				exists = event_target:zinara_country_target
				has_communications = event_target:zinara_country_target
			}
			country_event = { id = WL_lv_Zinara_contact_events.3004 days = 5 }
		}
	}
}

##########################################################
#Zinara Com
##########################################################
event = {
	id = WL_lv_Zinara_contact_events.6000
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		any_country = {
			OR = {  
				is_country_type = default
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
			AND = {
				exists = event_target:zinara_country_target
				NOT = { has_communications = event_target:zinara_country_target }
			}
		}
		exists = event_target:zinara_country_target
	}
	
	immediate = {
		every_country = {
			establish_communications_no_message = event_target:zinara_country_target
		}
	}
}