namespace = est_archivist

#Archivist 1, add Chronicler/Indexer trait to new leaders

country_event = {
	id = est_archivist.1
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		OR = {
			has_active_tradition = tr_est_archivist_2
			has_active_tradition = tr_est_archivist_2_GC
		}
		from = {
			leader_class = scientist
			NOT = {
				has_trait = leader_trait_roamer
				has_trait = leader_trait_roamer_2
				has_trait = leader_trait_roamer_3_est
			}
		}
	}
	
	immediate = {
		random_list = {
			9 = {}
			1 = {
				from = {
					random_list = {
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_mathematics }
						}
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_taxonomy } 
						}
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_mechanics } 
						}
					}
				}
			}
		}
	}
}

#Archivist 2, counts surveyed systems.
country_event = {
	id = est_archivist.2
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		exists = fromfrom
		always = yes
	}

	immediate = {	
		if = {
			limit = { is_variable_set = num_surveyed_systems }
			change_variable = {
				which = num_surveyed_systems
				value = 1
			}
		}
		else = {
			set_variable = {
				which = num_surveyed_systems
				value = 1
			}
		}
	}	
}

#Archivist 3, gains influence when a system have been surveyed.
country_event = {
	id = est_archivist.3
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {			
		has_tradition = tr_est_archivist_4
		exists = fromfrom
	}
	
	immediate = {
		add_resource = { 
			influence = 10
		}
	}
}