############################################
# 希灵领袖事件
############################################

namespace = xilin_leader

#领导人复活项目

#船被击毁时复活
# This = owner of fleet 1 (destroyed)
# From = owner of fleet 2 (combatant)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
country_event = {
	id = xilin_leader.1
  title = xilin_leader.1.name
	desc = xilin_leader.1.desc
	picture = GFX_evt_debris
#	hide_window = yes
	is_triggered_only = yes
 
	trigger = {
	  has_country_flag = f_xilin_empire  #只有希灵帝国才能复活
		fromfrom = {
			exists = leader
			fleet = { num_ships = 0 }
			leader = {
#				leader_class = admiral
				has_leader_flag = f_npc
			}
		}
	}

	immediate = {
	  if = {
	     limit = {
	        fromfrom = {
	           exists =leader
	        }
	     }
	     fromfrom = {  
	         leader = { save_event_target_as = dead_leader }
	     }
	  }
	  
    if = {
       limit = {#潘多拉
          fromfrom = {
			       exists = leader
			       leader = {
				        leader_class = admiral
				        has_leader_flag = f_panduola
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_panduola
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_PANDUOLA"
				     location = this
				     owner = root
			    }
		   }
    }
	  if = {
       limit = {#维斯卡
          fromfrom = {
			       exists = leader
			       leader = {
				        leader_class = admiral
				        has_leader_flag = f_weisika
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_weisika
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_WEISIKA"
				     location = this
				     owner = root
			    }
		   }
    }
    if = {
       limit = {#西维斯
          fromfrom = {
			       exists = leader
			       leader = {
				        leader_class = admiral
				        has_leader_flag = f_xiweisi
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_xiweisi
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_XIWEISI"
				     location = this
				     owner = root
			    }
		   }
    }
    if = {
       limit = {#许浅浅
          fromfrom = {
			       exists = leader
			       leader = {
				        has_leader_flag = f_xuqianqian
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_xuqianqian
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_XUQIANQIAN"
				     location = this
				     owner = root
			    }
		   }
    }
    if = {
       limit = {#泡泡
          fromfrom = {
			       exists = leader
			       leader = {
				        has_leader_flag = f_paopao
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_paopao
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_PAOPAO"
				     location = this
				     owner = root
			    }
		   }
    }
    if = {
       limit = {#阿赖耶
          fromfrom = {
			       exists = leader
			       leader = {
				        has_leader_flag = f_anaiye
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_anaiye
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_ANAIYE"
				     location = this
				     owner = root
			    }
		   }
    }
    if = {
       limit = {#塔维尔
          fromfrom = {
			       exists = leader
			       leader = {
				        has_leader_flag = f_taweier
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_taweier
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_TAWEIER"
				     location = this
				     owner = root
			    }
		   }
    }
    if = {
       limit = {#西卡罗
          fromfrom = {
			       exists = leader
			       leader = {
				        has_leader_flag = f_xikaluo
			       }
		      }
       }
       fromfrom = {
					leader = {
						exile_leader_as = exiled_to_xikaluo
					}
		   }
		   capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_XIKALUO"
				     location = this
				     owner = root
			    }
		   }
    }
	}#immediate
	option = {
		name = OK
	}
}



#潘多拉复活项目完成
country_event = {
	id = xilin_leader.2
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
    create_fleet = {
			set_take_point = yes
			effect = {
				set_owner = prev
				create_ship = {
						name = random
						random_existing_design = corvette
				}		
				set_location = prev.capital_scope
				set_leader = exiled_to_panduola
			}		
		}
    last_created_fleet = {
       leader = { 
         unassign_leader = this 
         save_event_target_as = resurrection_leader
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#维斯卡复活项目完成
country_event = {
	id = xilin_leader.3
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
    create_fleet = {
			set_take_point = yes
			effect = {
				set_owner = prev
				create_ship = {
						name = random
						random_existing_design = corvette
				}		
				set_location = prev.capital_scope
				set_leader = exiled_to_weisika
			}		
		}
    last_created_fleet = {
       leader = { 
         save_event_target_as = resurrection_leader
         unassign_leader = this 
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#西维斯复活项目完成
country_event = {
	id = xilin_leader.4
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
    create_fleet = {
			set_take_point = yes
			effect = {
				set_owner = prev
				create_ship = {
						name = random
						random_existing_design = corvette
				}		
				set_location = prev.capital_scope
				set_leader = exiled_to_xiweisi
			}		
		}
    last_created_fleet = {
       leader = {
         save_event_target_as = resurrection_leader 
         unassign_leader = this 
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#许浅浅复活项目完成
country_event = {
	id = xilin_leader.5
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
		create_fleet = {
			effect = {
				set_owner = prev
				create_ship = {
					name = random
					random_existing_design = science
				}
				set_fleet_stance = evasive				
				set_location = prev.capital_scope				
				set_leader = exiled_to_xuqianqian
			}			
		}
    last_created_fleet = {
       leader = { 
         save_event_target_as = resurrection_leader
         unassign_leader = this 
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#泡泡复活项目完成
country_event = {
	id = xilin_leader.6
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
		create_fleet = {
			effect = {
				set_owner = prev
				create_ship = {
					name = random
					random_existing_design = science
				}
				set_fleet_stance = evasive				
				set_location = prev.capital_scope				
				set_leader = exiled_to_paopao
			}			
		}
    last_created_fleet = {
       leader = { 
         save_event_target_as = resurrection_leader
         unassign_leader = this 
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#阿赖耶复活项目完成
country_event = {
	id = xilin_leader.7
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
		create_fleet = {
			effect = {
				set_owner = prev
				create_ship = {
					name = random
					random_existing_design = science
				}
				set_fleet_stance = evasive				
				set_location = prev.capital_scope				
				set_leader = exiled_to_anaiye
			}			
		}
    last_created_fleet = {
       leader = { 
         save_event_target_as = resurrection_leader
         unassign_leader = this 
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#塔维尔复活项目完成
country_event = {
	id = xilin_leader.8
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
		create_fleet = {
			effect = {
				set_owner = prev
				create_ship = {
					name = random
					random_existing_design = science
				}
				set_fleet_stance = evasive				
				set_location = prev.capital_scope				
				set_leader = exiled_to_taweier
			}			
		}
    last_created_fleet = {
       leader = { 
         save_event_target_as = resurrection_leader
         unassign_leader = this 
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#西卡罗复活项目完成
country_event = {
	id = xilin_leader.9
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
		create_fleet = {
			effect = {
				set_owner = prev
				create_ship = {
					name = random
					random_existing_design = transport
				}			
				set_location = prev.capital_scope				
				set_leader = exiled_to_xikaluo
			}			
		}
    last_created_fleet = {
       leader = { 
         save_event_target_as = resurrection_leader
         unassign_leader = this 
       }
       destroy_fleet = this
    }
		
	}

	option = {
		name = OK
	}
}

#领袖意外死亡或陆战死亡
# on leader death
# This = Country
# From = Leader
country_event = {
	id = xilin_leader.10
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		has_country_flag = f_xilin_empire
		from = {
		  has_leader_flag = f_npc
		}
	}
	
	immediate = {
			From = {
					switch = {
	    				trigger = has_leader_flag
	    				f_xikaluo = { prev = { country_event = { id = xilin_leader.11 } } } #西卡罗
	    				f_panduola = { prev = { country_event = { id = xilin_leader.12 } } } #潘多拉
	    				f_weisika = { prev = { country_event = { id = xilin_leader.13 } } } #维斯卡
	    				f_xiweisi = { prev = { country_event = { id = xilin_leader.14 } } } #西维斯
	    				f_paopao = { prev = { country_event = { id = xilin_leader.15 } } } #泡泡
	    				f_anaiye = { prev = { country_event = { id = xilin_leader.16 } } } #阿赖耶
	    				f_taweier = { prev = { country_event = { id = xilin_leader.17 } } } #塔维尔
	    				f_xuqianqian = { prev = { country_event = { id = xilin_leader.18 } } } #许浅浅
	    				f_chenjun = { prev = { country_event = { id = xilin_leader.19 } } } #陈俊
	    				f_shanduola = { prev = { country_event = { id = xilin_leader.20 } } } #珊多拉
	    				f_chenqian = { prev = { country_event = { id = xilin_leader.21 } } } #陈倩
	    				f_linxue = { prev = { country_event = { id = xilin_leader.22 } } } #林雪
	    		}			
			}	    
	}
}

#西卡罗陆战死亡
country_event = {
	id = xilin_leader.11
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制西卡罗
		set_country_flag=f_creating_leader
 		create_leader = {
					type = general
					species = owner_main_species					
					name = "NAME_xikaluo"
					traits = {
						trait = leader_trait_glory_seeker
					  trait = leader_trait_charismatic 
					  trait = leader_trait_xikaluo
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = no
    	 	  set_leader_flag = f_xikaluo
			    set_leader_flag = f_npc
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #西卡罗复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #西卡罗复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_xikaluo
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_XIKALUO"
				     location = this
				     owner = root
			    }
		}
	}	
}

#潘多拉死亡
country_event = {
	id = xilin_leader.12
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制潘多拉
		set_country_flag=f_creating_leader
 		create_leader = {
					type = admiral
					species = owner_main_species				
					name = "NAME_panduola"
					traits = {
						trait = leader_trait_aggressive
					  trait = leader_trait_cautious 
					  trait = leader_trait_panduola
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_panduola
			    set_leader_flag = f_npc
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #潘多拉复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #潘多拉复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_panduola
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_PANDUOLA"
				     location = this
				     owner = root
			    }
		}
	}	
}

#维斯卡死亡
country_event = {
	id = xilin_leader.13
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制维斯卡
		set_country_flag=f_creating_leader
 		create_leader = {
					type = admiral
					species = owner_main_species		
					name = "NAME_weisika"
					traits = {
						trait = leader_trait_aggressive
					  trait = leader_trait_cautious 
					  trait = leader_trait_weisika
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_weisika
			    set_leader_flag = f_npc	
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #维斯卡复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #维斯卡复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_weisika
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_WEISIKA"
				     location = this
				     owner = root
			    }
		}
	}	
}

#西维斯死亡
country_event = {
	id = xilin_leader.14
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制西维斯
		set_country_flag=f_creating_leader
 		create_leader = {
					type = admiral
					species = owner_main_species						
					name = "NAME_xiweisi"
					traits = {
						trait = leader_trait_aggressive
					  trait = leader_trait_cautious  
					  trait = leader_trait_xiweisi
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_xiweisi
			    set_leader_flag = f_npc
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #西维斯复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #西维斯复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_xiweisi
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_XIWEISI"
				     location = this
				     owner = root
			    }
		}
	}	
}

#泡泡死亡
country_event = {
	id = xilin_leader.15
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制泡泡
		set_country_flag=f_creating_leader
 		create_leader = {
					type = scientist
					species = owner_main_species						
					name = "NAME_paopao"
					traits = {
						trait = leader_trait_sapient_AI_assistant
					  trait = leader_trait_scientist_chosen 
					  trait = leader_trait_paopao
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_paopao
			    set_leader_flag = f_npc
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #泡泡复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #泡泡复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_paopao
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_PAOPAO"
				     location = this
				     owner = root
			    }
		}
	}	
}

#阿赖耶死亡
country_event = {
	id = xilin_leader.16
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制阿赖耶
		set_country_flag=f_creating_leader
 		create_leader = {
					type = scientist
					species = owner_main_species						
					name = "NAME_anaiye"
					traits = {
						trait = leader_trait_sapient_AI_assistant
					  trait = leader_trait_scientist_chosen 
					  trait = leader_trait_anaiye
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_anaiye
			    set_leader_flag = f_npc
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #阿赖耶复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #阿赖耶复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_anaiye
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_ANAIYE"
				     location = this
				     owner = root
			    }
		}
	}	
}

#塔维尔死亡
country_event = {
	id = xilin_leader.17
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制塔维尔
		set_country_flag=f_creating_leader
 		create_leader = {
					type = scientist
					species = owner_main_species						
					name = "NAME_taweier"
					traits = {
						trait = leader_trait_sapient_AI_assistant
					  trait = leader_trait_scientist_chosen 
					  trait = leader_trait_taweier
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_taweier
			    set_leader_flag = f_npc	
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #塔维尔复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #塔维尔复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_taweier
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_TAWEIER"
				     location = this
				     owner = root
			    }
		}
	}	
}

#许浅浅死亡
country_event = {
	id = xilin_leader.18
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制许浅浅
		set_country_flag=f_creating_leader
 		create_leader = {
					type = scientist
					species = event_target:GOD_HUMAN
					name = "NAME_xuqianqian"
					traits = {
						trait = leader_trait_meticulous
					  trait = leader_trait_roamer
					  trait = leader_trait_archaeologist 
					  trait = leader_trait_xuqianqian
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_xuqianqian
			    set_leader_flag = f_npc 
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #许浅浅复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #许浅浅复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_xuqianqian
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_XUQIANQIAN"
				     location = this
				     owner = root
			    }
		}
	}	
}

#陈俊受伤
country_event = {
	id = xilin_leader.19
	title = xilin_leader.19.name
	desc = xilin_leader.19.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制陈俊
		set_country_flag=f_creating_leader
 		create_leader = {
					type = governor
					species = event_target:GOD_HUMAN
					name = "NAME_chenjun"	
					traits = {
						trait = leader_trait_architectural_interest
						trait = leader_trait_intellectual
						trait = leader_trait_chenjun
					}
		 }
		 last_created_leader = {               
					set_age = 20
					set_is_female = no
					set_leader_flag = f_chenjun
			    set_leader_flag = f_npc		   
     }
     #陈俊复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #陈俊复制体准备
		 assign_leader = last_created_leader
		 leader = { 
	      	remove_trait = trait_ruler_corvette_focus
	     	 	remove_trait = trait_ruler_destroyer_focus
	     		remove_trait = trait_ruler_fortifier
	      	remove_trait = trait_ruler_battleship_focus
	     		remove_trait = trait_ruler_recruiter
	      	remove_trait = trait_ruler_military_pioneer
	      	remove_trait = trait_ruler_warlike
	      	remove_trait = trait_ruler_world_shaper
	      	remove_trait =trait_ruler_home_in_the_sky
	      	remove_trait =trait_ruler_industrialist
	      	remove_trait =trait_ruler_champion_of_the_people
	      	remove_trait=trait_ruler_expansionist
	      	remove_trait=trait_ruler_fertility_preacher
	      	remove_trait=trait_ruler_investor
	      	remove_trait=trait_ruler_space_miner
	      	remove_trait=trait_ruler_explorer
	      	remove_trait=trait_ruler_eye_for_talent	      	
	      	add_trait =trait_ruler_cruiser_focus
	      	add_trait =trait_ruler_logistic_understanding
	      	add_trait =trait_ruler_architectural_sense
	      	add_trait =trait_ruler_frontier_spirit
	      	add_trait =trait_ruler_deep_connections
	      	add_trait =trait_ruler_charismatic
	      	add_trait =leader_trait_chenjun
	      	add_trait =leader_ruler_trait_weak
	      	
	      	set_leader_flag = f_chenjun
	      	set_leader_flag = f_npc
					 
			    #复制通过事件获得的trait
	   }
		 remove_country_flag = f_creating_leader
		 
		 
		 
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_CHENJUN"
				     location = this
				     owner = root
			    }
		}
	}	
}

#珊多拉死亡
country_event = {
	id = xilin_leader.20
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制珊多拉
		set_country_flag=f_creating_leader
 		create_leader = {
					type = governor
					species = owner_main_species						
					name = "NAME_shanduola"
					traits = {
						trait = leader_trait_architectural_interest
						trait = leader_trait_intellectual
						trait = leader_trait_shanduola
					}
		}
		last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_shanduola
			    set_leader_flag = f_npc
			    save_event_target_as = resurrection_leader
	   }
		 remove_country_flag = f_creating_leader
		 #珊多拉复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #珊多拉复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_shanduola
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_SHANDUOLA"
				     location = this
				     owner = root
			    }
		}
	}	
}

#陈倩死亡
country_event = {
	id = xilin_leader.21
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制陈倩
		set_country_flag=f_creating_leader
 		create_leader = {
					type = governor
					species = event_target:GOD_HUMAN
					name = "NAME_chenqian"
					traits = {
						trait = leader_trait_architectural_interest
						trait = leader_trait_intellectual
						trait = leader_trait_chenqian
					}
		 }
		 last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_chenqian
			    set_leader_flag = f_npc		
			    save_event_target_as = resurrection_leader	    
     }
		 remove_country_flag = f_creating_leader
		 #陈倩复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #陈倩复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_chenqian
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_CHENQIAN"
				     location = this
				     owner = root
			    }
		}
	}	
}

#林雪死亡
country_event = {
	id = xilin_leader.22
	title = xilin_leader.11.name
	desc = xilin_leader.11.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
	immediate = {
		#复制林雪
		set_country_flag=f_creating_leader
 		create_leader = {
					type = governor
					species = event_target:GOD_HUMAN	
					name = "NAME_linxue"
					traits = {
						trait = leader_trait_architectural_interest
						trait = leader_trait_intellectual
						trait = leader_trait_linxue
					}
		 }
		 last_created_leader = {               
					set_age = 20
					set_is_female = yes
					set_leader_flag = f_linxue
			    set_leader_flag = f_npc			
			    save_event_target_as = resurrection_leader    
     }
		 remove_country_flag = f_creating_leader
		 #林雪复制体等级设置
		 fromfrom = {
		    switch = {
		       trigger = has_level
		       10 = { event_target:resurrection_leader = { set_skill = 10 } }
		       9 = { event_target:resurrection_leader = { set_skill = 9 } }
		       8 = { event_target:resurrection_leader = { set_skill = 8 } }
		       7 = { event_target:resurrection_leader = { set_skill = 7 } }
		       6 = { event_target:resurrection_leader = { set_skill = 6 } }
		       5 = { event_target:resurrection_leader = { set_skill = 5 } }
		       4 = { event_target:resurrection_leader = { set_skill = 4 } }
		       3 = { event_target:resurrection_leader = { set_skill = 3 } }
		       2 = { event_target:resurrection_leader = { set_skill = 2 } }
		    }
		 }
		 #林雪复制体准备
		 event_target:resurrection_leader = {
		     exile_leader_as = exiled_to_linxue
		 }
	}

	option = {
		name = OK
		capital_scope = {
			    enable_special_project = {
				     name = "PRO_LEADER_RESURRECTION_LINXUE"
				     location = this
				     owner = root
			    }
		}
	}	
}

#陈俊治疗项目完成
country_event = {
	id = xilin_leader.23
	title = xilin_leader.23.name
	desc = xilin_leader.23.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
		leader = {
				remove_trait = leader_ruler_trait_weak
		}
	}

	option = {
		name = OK
	}
}

#珊多拉复活项目完成
country_event = {
	id = xilin_leader.24
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
    set_leader = exiled_to_shanduola    
    random_owned_leader = {
       limit = { has_leader_flag = f_chenjun }
       save_event_target_as = leader_chenjun
    }
    assign_leader = event_target:leader_chenjun
    random_owned_leader = {
       limit = { has_leader_flag = f_shanduola }
       save_event_target_as = resurrection_leader
    }
	}

	option = {
		name = OK
	}
}

#陈倩复活项目完成
country_event = {
	id = xilin_leader.25
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
    set_leader = exiled_to_chenqian   
    random_owned_leader = {
       limit = { has_leader_flag = f_chenjun }
       save_event_target_as = leader_chenjun
    }
    assign_leader = event_target:leader_chenjun
    random_owned_leader = {
       limit = { has_leader_flag = f_chenqian }
       save_event_target_as = resurrection_leader
    }
	}

	option = {
		name = OK
	}
}

#林雪复活项目完成
country_event = {
	id = xilin_leader.26
	title = xilin_leader.2.name
	desc = xilin_leader.2.desc
	picture = GFX_evt_psionics

	is_triggered_only = yes
	
  immediate = {
    set_leader = exiled_to_linxue  
    random_owned_leader = {
       limit = { has_leader_flag = f_chenjun }
       save_event_target_as = leader_chenjun
    }
    assign_leader = event_target:leader_chenjun
    random_owned_leader = {
       limit = { has_leader_flag = f_linxue }
       save_event_target_as = resurrection_leader
    }
	}

	option = {
		name = OK
	}
}