################################################
#	Motherly Hive Pop Limit Events
################################################

namespace = WL_LV_motherly_hive_pop_limit_events

#TODO: fix pop selection (not sure if selecting by job is still possible) and change kill_pop to kill_pop_group

event = {
	id = WL_LV_motherly_hive_pop_limit_events.1
	hide_window = yes
	is_triggered_only = yes
	location = root
	
#	trigger = {
#		any_country = {
#			is_hive_empire = yes
#			OR = {
#				has_civic = civic_WL_lv_motherly_hive
#				has_origin = origin_WL_lv_motherly_hive
#				has_country_flag = SYSTEM_non_hive_pop_200_limit_per_planet
#				has_country_flag = SYSTEM_non_hive_pop_100_limit_per_planet
#				has_country_flag = SYSTEM_non_hive_pop_25_limit_per_planet
#				has_country_flag = SYSTEM_non_hive_pop_50_limit_per_planet
#				has_country_flag = SYSTEM_non_hive_pop_0_limit_per_planet
#			}
#			any_owned_planet = {
#				NOT = {	has_planet_flag = SYSTEM_PLANET_motherly_limit_population_protection }
#				any_owned_pop_job = {
#					OR = {
#						has_job_type = WL_lv_hive_livestock_breeding_pop
#						has_job_type = WL_lv_hive_xeno_breeding_pop
#					}
#				}
#			}
#		}
#	}
	
#	immediate = {
#		every_country = {
#			limit = { 
#					is_hive_empire = yes
#					OR = {	
#						has_civic = civic_WL_lv_motherly_hive	
#						has_origin = origin_WL_lv_motherly_hive
#						has_country_flag =  SYSTEM_non_hive_pop_200_limit_per_planet
#						has_country_flag =  SYSTEM_non_hive_pop_100_limit_per_planet
#						has_country_flag =  SYSTEM_non_hive_pop_25_limit_per_planet
#						has_country_flag =  SYSTEM_non_hive_pop_50_limit_per_planet
#						has_country_flag =  SYSTEM_non_hive_pop_0_limit_per_planet
#					}
#			}
#			every_owned_planet = {
#					limit = {
#						NOT = {	has_planet_flag = SYSTEM_PLANET_motherly_limit_population_protection }
#						any_owned_pop_job = {
#							OR = {
#								has_job_type = WL_lv_hive_livestock_breeding_pop
#								has_job_type = WL_lv_hive_xeno_breeding_pop
#							}
#						}
#					}
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 25
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_25_limit_per_planet 
#								has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.10 } #HIDDEN
#					}
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 25
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_25_limit_per_planet 
#								NOT = { has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events }
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.11 } #NOT HIDDEN
#					}
#					
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 50
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_50_limit_per_planet 
#								has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.12 } #HIDDEN
#					}
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 50
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_50_limit_per_planet 
#								NOT = { has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events }
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.13 } #NOT HIDDEN
#					}
#					
#					
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 0
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_0_limit_per_planet 
#								has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.14 } #HIDDEN
#					}
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 0
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_0_limit_per_planet 
#								NOT = { has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events }
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.15 } #NOT HIDDEN
#					}
#					
#					
#					
#					###############
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 50
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_100_limit_per_planet 
#								has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.12 } #HIDDEN
#					}
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 50
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_100_limit_per_planet 
#								NOT = { has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events }
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.13 } #NOT HIDDEN
#					}
#					###############
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 50
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_200_limit_per_planet 
#								has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.12 } #HIDDEN
#					}
#					IF = {
#						limit = {
#							count_owned_pop_amount = { 
#								limit = {
#									is_being_purged = no
#									is_being_assimilated = no
#									OR = {
#										has_job_type = WL_lv_hive_livestock_breeding_pop
#										has_job_type = WL_lv_hive_xeno_breeding_pop
#									} 
#								} 
#								count > 50
#							}
#							OWNER = { 
#								has_country_flag = SYSTEM_non_hive_pop_200_limit_per_planet 
#								NOT = { has_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events }
#							}
#						}
#						planet_event = { id = WL_LV_motherly_hive_pop_limit_events.13 } #NOT HIDDEN
#					}
#					
#			}
#		}
#	}
}

#planet_event = {
#	id = WL_LV_motherly_hive_pop_limit_events.10
#	hide_window = yes
#	is_triggered_only = yes
#	
#	immediate = {
#		owner = { 
#			add_resource = { unity = -2 }
#		}	
#		while = {
#				count = 1
#				random_pop = {
#					limit = {
#							OR = {
#								has_job_type = WL_lv_hive_xeno_breeding_pop
#								has_job_type = WL_lv_hive_livestock_breeding_pop
#							}
#							is_being_purged = no
#							is_being_assimilated = no
#					}
#					kill_pop = yes
#				}
#		}
#	}
#}
#
#planet_event = {
#	id = WL_LV_motherly_hive_pop_limit_events.11
#	title = WL_LV_motherly_hive_pop_limit_events.11.name
#	desc = WL_LV_motherly_hive_pop_limit_events.11.desc
#	picture = GFX_evt_alien_city
#	show_sound = event_alien_nature
#	location = root
#	hide_window = no
#	is_triggered_only = yes
#
#	option = {
#		name = "WL_LV_motherly_hive_pop_limit_events.11.a"	
#	}
#	
#	option = {
#		name = "WL_LV_motherly_hive_pop_limit_events.11.b"	
#		owner = { 
#			set_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#		}
#	}
#	
#	immediate = {	
#		owner = { 
#			add_resource = { unity = -2 }
#		}
#		while = {
#				count = 1
#				random_pop = {
#					limit = {
#							OR = {
#								has_job_type = WL_lv_hive_xeno_breeding_pop
#								has_job_type = WL_lv_hive_livestock_breeding_pop
#							}
#							is_being_purged = no
#							is_being_assimilated = no
#					}
#					kill_pop = yes
#				}
#		}	
#	}
#}
#
#planet_event = {
#	id = WL_LV_motherly_hive_pop_limit_events.12
#	hide_window = yes
#	is_triggered_only = yes
#	
#	immediate = {	
#		owner = { 
#			add_resource = { unity = -1 }
#		}
#		while = {
#				count = 1
#				random_pop = {
#					limit = {
#							OR = {
#								has_job_type = WL_lv_hive_xeno_breeding_pop
#								has_job_type = WL_lv_hive_livestock_breeding_pop
#							}
#							is_being_purged = no
#							is_being_assimilated = no
#					}
#					kill_pop = yes
#				}
#		}	
#	}
#}
#
#planet_event = {
#	id = WL_LV_motherly_hive_pop_limit_events.13
#	title = WL_LV_motherly_hive_pop_limit_events.13.name
#	desc = WL_LV_motherly_hive_pop_limit_events.13.desc
#	picture = GFX_evt_alien_city
#	show_sound = event_alien_nature
#	location = root
#	hide_window = no
#	is_triggered_only = yes
#	
#	option = {
#		name = "WL_LV_motherly_hive_pop_limit_events.13.a"	
#	}
#	
#	option = {
#		name = "WL_LV_motherly_hive_pop_limit_events.13.b"	
#		owner = { 
#			set_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#		}
#	}
#	
#	immediate = {
#		owner = { 
#			add_resource = { unity = -1 }
#		}	
#		while = {
#				count = 1
#				random_pop = {
#					limit = {
#							OR = {
#								has_job_type = WL_lv_hive_xeno_breeding_pop
#								has_job_type = WL_lv_hive_livestock_breeding_pop
#							}
#							is_being_purged = no
#							is_being_assimilated = no
#					}
#					kill_pop = yes
#				}
#		}	
#	}
#}
#
#planet_event = {
#	id = WL_LV_motherly_hive_pop_limit_events.14
#	hide_window = yes
#	is_triggered_only = yes
#	
#	immediate = {	
#		owner = { 
#			add_resource = { unity = -3 }
#		}
#		while = {
#				count = 1
#				random_pop = {
#					limit = {
#							OR = {
#								has_job_type = WL_lv_hive_xeno_breeding_pop
#								has_job_type = WL_lv_hive_livestock_breeding_pop
#							}
#							is_being_purged = no
#							is_being_assimilated = no
#					}
#					kill_pop = yes
#				}
#		}	
#	}
#}
#
#planet_event = {
#	id = WL_LV_motherly_hive_pop_limit_events.15
#	title = WL_LV_motherly_hive_pop_limit_events.13.name
#	desc = WL_LV_motherly_hive_pop_limit_events.13.desc
#	picture = GFX_evt_alien_city
#	show_sound = event_alien_nature
#	location = root
#	hide_window = no
#	is_triggered_only = yes
#	
#	option = {
#		name = "WL_LV_motherly_hive_pop_limit_events.13.a"	
#		owner = { 
#			add_resource = { unity = -3 }
#		}
#	}
#	
#	option = {
#		name = "WL_LV_motherly_hive_pop_limit_events.13.b"	
#		owner = { 
#			add_resource = { unity = -3 }
#			set_country_flag = SYSTEM_n_h_m_hidden_pop_limit_events
#		}
#	}
#	
#	immediate = {
#		while = {
#				count = 1
#				random_pop = {
#					limit = {
#							OR = {
#								has_job_type = WL_lv_hive_xeno_breeding_pop
#								has_job_type = WL_lv_hive_livestock_breeding_pop
#							}
#							is_being_purged = no
#							is_being_assimilated = no
#					}
#					kill_pop = yes
#				}
#		}	
#	}
#}