# this = country
on_monthly_pulse_country = {
	events = {
		est_shroudborn.1
		est_shroudborn.2
		est_hacking.1
		est_hacking.2
		est_hacking.3
		est_hacking.4
		est_hacking.5
		
		est_commerce.1
		
		est_cybernetics.1
		est_serverbound.1
		
		est_friendship.4

		est_foundation.1
		est_subminds.3

		est_greed.1
		
		est_isolation.1
		est_isolation.2
		est_proselytism.1
		est_proselytism.2
		est_proselytism.6
		est_proselytism.7
		
		est_liberty.1
			
		est_justice.1
		est_destruction.4
		est_destruction.5
		
		est_militarism.1
		est_might.1
		
		est_philosophy.1
		est_philosophy.2
		
		est_order.1
		est_cooperativity.1
		
		est_piracy.3
		
		est_collectivism.1
	}
}

# this = country
on_yearly_pulse_country = {
	events = {
		est_friendship.5
		est_friendship.6

		est_confederacy.2
		
		est_liberty.2
		
		est_order.4
		est_order.5
		
		est_piracy.3
		est_piracy.4
	}
}

# A ship has been built
# Root = Ship
# From = Planet
on_ship_built = {
	events = {		
		est_mechanicum.1
		
		est_swarm.1
	}
}

# A ship has been upgraded
#  Root = Ship
on_ship_upgraded = {
	events = {
	}
}

#A building construction has been completed.
# This = Army
# From = Planet
on_army_recruited = {
	events = {
		#Meant to have The Swarm event "Hordes" here, when on action is fixed by paradox.
	}
}

#Fired whenever a new owner is set for a planet,
#be it after a war or through a trade
#From = Country scope
#This = Planet scope
on_planet_transfer = {
	events = {		
		est_general.2

		est_aesthetics.2
		
		est_archivist.1

		est_friendship.8
		est_friendship.11
		
		est_desires.2
		
		est_proselytism.5

		est_nature.1

		est_piracy.6
		
		est_spaceborn.3
	}
}

#From = Country scope
#This = Planet scope
on_planet_ownerless = {
	events = {		
		#est.17	
	}
}

# From = system
# FromFrom = country (new owner)
# This = country (previous owner)
on_system_lost = {
	events = {
		est_spaceborn.1
	}
}

# From = system
# FromFrom = country (previous owner)
# This = country (new owner)
on_system_gained = {
	events = {
		est_spaceborn.2
	}
}

# A country has increased the level of a tech, use last_increased_tech trigger to check tech and level.
# This = Country
on_tech_increased = {
	events = {
		est_archivist.7
		
		est_foundation.3
	}
}

# Pop is enslaved
# This = Pop scope
# owner_species = { (species)
# owner = { owner_species = { (empire main species)
# owner = { (empire)
on_pop_enslaved = {
	events = {		
		est_friendship.9
	}
}

# Pop is released from slavery
# This = Pop scope
# owner_species = { (species)
# owner = { owner_species = { (empire main species)
# owner = { (empire)
on_pop_emancipated = {
	events = {
		est_friendship.10
	}
}

# This = owner of ship 1 (combatant)
# From = owner of ship 2 (destroyed)
# FromFrom = ship 1
# FromFromFrom = ship 2
on_ship_destroyed_perp = {
	events = {
		est_chivalry.7
		
		est_friendship.14
		
		est_piracy.2
	}
}

# This = owner of fleet 1
# From = owner of fleet 2
# FromFrom = fleet 1
# FromFromFrom = fleet 2
on_entering_battle = {
	events = {
		est_destruction.2
	
		est_fury.3
	}
}

# This = owner of fleet 1 (winner)
# From = owner of fleet 2 (loser)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
on_space_battle_won = {
	events = {
		est_chivalry.5
		
		est_destruction.3
		
		est_fury.4
	}
}

# A fleet has successfully escaped from combat, executed right before the fleet enters FTL
# This = escaping fleet
# From = system escaped from
# FromFrom = system escaping to
on_emergency_ftl = {
	events = {
		est_chivalry.6
	}
}

# A planet has begun the colonization process.
# Scope = Planet
on_colonization_started = {
	events = {		
	}
}

# A planet has been colonized.
# Scope = Planet
on_colonized = {
	events = {
		est_archivist.1

		est_desires.2
		
		est_liberty.3
		
		est_nature.1
		est_nature.2
		
		est_spaceborn.3		
	}
}

# A colony has been destroyed. Called just before owner and controller is cleared
# Scope = Planet
on_colony_destroyed = {
	events = {
		est_general.2
	}
}

# Executed when the ruler is ousted and goes back to their pre-ruler class
# From = Previous Ruler, already has the new class
# This = Country
on_ruler_back_to_pre_ruler_class = {
	events = {
		est_archivist.4
		est_archivist.5
		
		est_chivalry.1

		est_confederacy.1
		
		est_militarism.2
		
		est_mystery.1
		
		est_cooperativity.2
	}
}

# a new leader is generated for an empire, to be available for recruitment
# scope: country, from: leader
on_leader_spawned = {
	events = {
		est_academy.2
		
		est_administratum.1
		
		est_archivist.2
		est_archivist.3
		est_archivist.4
		est_archivist.5		
		
		est_chivalry.2

		est_confederacy.1
		
		est_militarism.2
		
		est_mystery.2
		
		est_cooperativity.3		
		
		est_individualism.2
	}
}

# Executed as a leader has died
# This = Country
# From = Leader
on_leader_death = {
	events = {
		est_archivist.4
		est_archivist.5
	}
}

# A leader leveled up.
# Scope = Country
# From = Leader
on_leader_level_up = {
	events = {
		est_academy.3
		
		est_individualism.1
	}
}

# Executed as new ruler has been set
# This = Country
on_ruler_set = {
	events = {
		est_chivalry.8
	}
}

# A ship has surveyed a planet.
# Scope = Ship
# From = Planet
on_survey = {
	events = {
		est_individualism.3
	}
}

# A country has gained a surveyed status on a planet. Happens after "on_survey" if a science ship surveyed a planet.
# Root = Country
# From = system
# FromFrom = Fleet of the science ship that surveyed it, if any
on_system_survey = {
	events = {
		est_archivist.6
	}
}

#A building construction has been completed.
# This = Planet
# From = Tile
on_building_complete = {
	events = {
		est_aesthetics.1
		est_aesthetics.4
	}
}

# A building construction has been queued.
# This = Planet
on_building_queued = {
	events = {
	}
}

# A building construction has been completed, which is an upgrade of previous building.
# This = Planet
# From = Tile
on_building_upgraded = {
	events = {
		est_aesthetics.1
	}
}

# A building construction has finished, replacing another building.
# This = Planet
# From = Tile
on_building_replaced = {
	events = {
		est_aesthetics.1
		est_aesthetics.5
	}
}

# A building construction has demolished.
# This = Planet
# From = Tile
on_building_demolished = {
	events = {
		est_aesthetics.1
		est_aesthetics.5
	}
}

# A pop has finished assembling
# This = Planet scope
# From = Country
# FromFrom = Pop
on_pop_assembled = {
	events = {
		est_general.3
	}
}

# We changed a species right
# This = pop
on_pop_rights_change = {
	events = {
	}
}

# A pop has finished purging
# This = Planet scope
# From = Country
# FromFrom = Pop
on_pop_purged = {
	events = {
		est_venerability.1
		est_venerability.2
		
		est_destruction.1
	}
}

# Triggers country_event for the attacker upon victory
# (Before controller is switched)
# This = country, leader attacker
# From = country, planet owner
# FromFrom = planet
on_planet_attackers_win = {
	events = {
		est_chivalry.4
		
		est_friendship.7
		
		est_fury.5
		
		est_piracy.5
	}
}

# Triggers country_event for the defender upon victory
# Root = country, planet owner
# From = country, attack leader
# FromFrom = planet
on_planet_defenders_win = {
	events = {
		est_chivalry.3
	}
}

# A war is beginning, executed for every country in the war.
# Root = Country
# From = War
on_war_beginning = {
	events = {
		est_general.4
		
		est_friendship.2
		est_friendship.12
		
		est_destruction.7
	}
}

# A war has been won
# Root = Winner Warleader
# From = Loser Warleader
# FromFrom = War
on_war_won = {
	events = {
		est_general.5
		
		est_proselytism.8
		
		est_perseverance.1
	}
}

# A status quo has been signed
# Root = Actor
# From = Recipient
# FromFrom = Main Attacker
# FromFromFrom = Main Defender
# FromFromFromFrom = War
on_status_quo = {
	events = {
		est_general.6
	}
}

# A status quo has been signed, by force
# Root = Recipient
# From = Actor
# FromFrom = Main Attacker
# FromFromFrom = Main Defender
# FromFromFromFrom = War
on_status_quo_forced = {
	events = {
		est_general.6
	}
}

# Executed right after country has established communications with another country
# This = Country which established the communications
# From = Country which communications were established with
on_post_communications_established = {
	events = {
		est_friendship.1
	}
}
