classical_age = {
	start = 2
	
	can_start = {
		always = yes
	}

	objectives = {
		obj_classical_empire = {
			OR = {
				government_rank = 3
				is_emperor_of_china = yes
			}
		}
		obj_classical_monuments = {
			calc_true_if = {
				all_owned_province = {
					has_building = glorious_monument
					controlled_by = owner
					is_core = ROOT
				}
				amount = 5
			}
		}
		obj_classical_scientist = {
			advisor = natural_scientist
		}
		obj_classical_prestige = {
			prestige = 90
		}
		obj_classical_no_unrest = {
			all_owned_province = {
				NOT = { unrest = 0.1 }
			}
		}
		obj_classical_great_cities = {
			calc_true_if = {
				all_owned_province = {
					development = 10
				}
				amount = 20
			}
		}
		obj_classical_income = {
			monthly_income = 50
		}
	}		
	
	abilities = {
		ab_classical_architecture = {
			modifier = {
				build_cost = -0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_classical_philosophy = {
			modifier = {
				adm_tech_cost_modifier = -0.1
			}
			ai_will_do = {
				factor = 10
			}			
		}
		ab_classical_additional_generals = {
			modifier = {
				free_leader_pool = 1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_classical_ambush_tactics = {
			modifier = {
				hostile_attrition = 1.0
			}
			ai_will_do = {
				factor = 10
			}	
		}
		ab_classical_great_people = {
			modifier = {
				advisor_cost = -0.05
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_classical_defence = {
			modifier = {
				enemy_core_creation = 0.5
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_classical_terrain = {
			rule = {
				attack_bonus_in_capital_terrain = yes
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_classical_roman_stability = {
			allow = {
				tag = ROM
			}
			modifier = {
				global_unrest = -2
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_classical_parthian_cavalry = {
			allow = {
				tag = PRT
			}
			modifier = {
				cavalry_flanking = 0.5
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_classical_han_administration = {
			allow = {
				tag = HND
			}
			modifier = {
				global_tax_modifier = 0.15
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_classical_satavahana_syncretism = {
			allow = {
				tag = SAT
			}
			modifier = {
				tolerance_heathen = 3
			}
			ai_will_do = {
				factor = 100
			}
		}
	}
}

late_classical_age = {
	start = 200
	
	can_start = {
		any_country = { adm_tech = 8 }
	}
	
	objectives = {
		obj_lateclassical_unite_culture = {
			has_unified_culture_group = yes
		}
		obj_lateclassical_idea_group = {
			OR = {
				full_idea_group = early_adm_ideas
				full_idea_group = early_religious_ideas
				full_idea_group = early_dip_ideas
				full_idea_group = early_trade_ideas
				full_idea_group = early_mil_ideas
				full_idea_group = early_defensive_ideas
			}
		}
		obj_lateclassical_general = {
			has_leader_with = { shock = 4 }
		}
		obj_lateclassical_50_years_of_peace = {
			NOT = { had_recent_war = 50 }
		}
		obj_lateclassical_low_autonomy = {
			all_owned_province = {
				NOT = { local_autonomy = 30 }
			}
		}
		obj_lateclassical_treasury = {
			treasury = 10000
		}
		obj_lateclassical_manpower_limit = {	
			manpower_percentage = 0.99
		}
	}	
	
	
	abilities = {
		ab_lateclassical_elite_guard = {
			modifier = {
				discipline = 0.02
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_lateclassical_expeditions = {
			modifier = {
				trade_range_modifier = 0.2
				range = 0.2
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_lateclassical_conscription = {
			modifier = {
				global_manpower_modifier = 0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_lateclassical_resist_christianity = {
			allow = {
				NOT = { religion_group = christianity }
			}
			effect = {
				custom_tooltip = slows_down_the_spread_of_christianity
				set_country_flag = lateclassical_resist_christianity_flag
			}
			ai_will_do = {
				factor = 0
			}
		}
		ab_lateclassical_generals = {
			modifier = {
				leader_land_shock = 1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_lateclassical_administration = {
			modifier = {
				administrative_efficiency = 0.03
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_lateclassical_diplomacy = {
			modifier = {
				diplomatic_upkeep = 1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_lateclassical_sassanid_cataphracts = {
			allow = {
				tag = SAS
			}
			modifier = {
				cavalry_power = 0.2
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_lateclassical_aksumite_traders = {
			allow = {
				tag = AKS
			}
			modifier = {
				merchants = 1
			}
			ai_will_do = {
				factor = 100
			}
		}
		
		ab_lateclassical_gupta_golden_age = {
			allow = {
				tag = GUP
			}
			modifier = {
				technology_cost = -0.05
			}
			ai_will_do = {
				factor = 100
			}
		}
		
		ab_lateclassical_goguryeo_military = {
			allow = {
				tag = GOG
			}
			modifier = {
				infantry_power = 0.1
			}
			ai_will_do = {
				factor = 100
			}
		}
	}
}

age_of_migrations = {
	start = 400
	
	can_start = {
		any_country = { mil_tech = 15 }
	}
	
	objectives = {
		obj_migration_christianity = {
			religion_group = christian
		}
		obj_migration_conquer_roman_province = {
			NOT = { tag = ROM }
			NOT = { tag = ROW }
			NOT = { tag = BYZ }
			any_owned_province = {
				OR = {
					is_core = ROM
					is_core = ROW
					is_core = BYZ
				}
			}
		}
		obj_migration_fortify_borders = {
			calc_true_if = {
				all_owned_province = {
					fort_level = 1
					any_neighbor_province = {
						NOT = { owned_by = ROOT }
					}
				}
				amount = 3
			}
		}
		obj_migration_barb_reform_gov = {
			custom_trigger_tooltip = {
				tooltip = reformed_government_as_barbarian_tribe
				has_country_flag = barbarian_reformed_government
			}
		}
		obj_migration_cavalry = {
			num_of_cavalry = 30
		}
		obj_migration_roads = {
			all_owned_province = {
	 			has_building = road
	 		}
		}
		obj_migration_army_tradition = {
			army_tradition = 75
		}
	}	

	abilities = {
		ab_migration_foraging = {
			modifier = {
				land_attrition = -0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_migration_resettlement = {
			modifier = {
				culture_conversion_cost = -0.10
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_migration_expansion = {
			modifier = {
				core_creation = -0.05
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_migration_marching = {
			modifier = {
				movement_speed = 0.15
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_migration_looting = {
			modifier = {
				loot_amount = 0.25
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_migration_border_walls = {
			modifier = {
				defensiveness = 0.15
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_migration_siege = {
			modifier = {
				siege_ability = 0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_migration_migration = {
			allow = {
				OR = {
					government = native_council
					government = siberian_native_council
				}
			}
			modifier = {
				migration_cooldown = -0.5
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_migration_horde_razing = {
			allow = {
				government = steppe_horde
				NOT = { tag = HNS }
			}
			modifier = {
				raze_power_gain = 0.50
			}
			ai_will_do = {
				factor = 100
			}
		}	
		ab_migration_barbarian_swarm = {
			allow = {
				government = barbarian_tribe
			}
			modifier = {
				land_maintenance_modifier = -0.20
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_migration_hunnic_horde = {
			allow = {
				tag = HNS
			}
			modifier = {
				discipline = 0.05
				cavalry_cost = -0.2
			}
			ai_will_do = {
				factor = 100
			}
		}
	}
}

dark_age = {
	start = 600
	
	can_start = {
		is_institution_enabled = manorialism
	}
	
	objectives = {
		obj_darkage_no_devastation = {
			all_owned_province = {
				NOT = { devastation = 1 }
			}
		}
		obj_darkare_rome = {
			owns = 118
		}
		obj_darkage_muslim = {
			religion_group = muslim
		}
		obj_darkage_temples = {
			calc_true_if = {
				all_owned_province = {
					has_building = temple
					controlled_by = owner
					is_core = ROOT
				}
				amount = 10
			}
		}	
		obj_darkage_buddhism = {
			OR = {
				religion = mahayana
				religion = buddhism
				religion = vajrayana
				secondary_religion = mahayana
				secondary_religion = buddhism
				secondary_religion = vajrayana
				has_country_modifier = harmonized_mahayana
				has_country_modifier = harmonized_buddhism
				has_country_modifier = harmonized_vajrayana
			}
		}
		obj_darkage_win_wars = {
			check_variable = {
				which = num_of_wars_won
				value = 5
			}
		}
		obj_darkage_emperor_of_china = {
			is_emperor_of_china = yes
			imperial_mandate = 50
		}
	}

	abilities = {
		ab_darkage_raiding = {
			modifier = {
				privateer_efficiency = 0.25
			}
			ai_will_do = {
				factor = 10
				modifier = {
					factor = 0
					NOT = { num_of_ports = 5 }
				}
			}
		}
		ab_darkage_border_disputes = {
			modifier = {
				fabricate_claims_cost = -0.25
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_darkage_spies = {
			modifier = {
				spy_offence = 0.2
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_darkage_stable_empire = {
			modifier = {
				stability_cost_modifier = -0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_darkage_warlords = {
			modifier = {
				free_leader_pool = 1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_darkage_fire_galleys = {
			modifier = {
				galley_power = 0.2
			}
			ai_will_do = {
				factor = 10
				modifier = {
					factor = 0
					NOT = { num_of_ports = 5 }
				}
			}
		}
		ab_darkage_religious_acceptance = {
			modifier = {
				tolerance_heretic = 1
				tolerance_heathen = 2
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_darkage_tibetan_empire = {
			allow = {
				tag = TIB
			}
			modifier = {
				discipline = 0.05
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_darkage_frankish_states = {
			allow = {
				OR = {
					primary_culture = frankish
					primary_culture = cosmopolitan_french
				}
			}
			modifier = {
				max_states = 3
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_darkage_chinese_innovation = {
			allow = {
				is_emperor_of_china = yes
			}
			modifier = {
				idea_cost = -0.1
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_darkage_mulim_expansion = {
			allow = {
				government = caliphate
			}
			modifier = {
				core_creation = -0.15
			}
			ai_will_do = {
				factor = 100
			}
		}
	}
}

feudal_age = {
	start = 800
	
	can_start = {
		is_institution_enabled = crop_rotation
	}
	
	objectives = {
		obj_feudal_horde_in_europe = {
			government = steppe_horde
			any_owned_province = { continent = europe }
		}
		
		obj_feudal_vassals = {
			vassal = 3
		}
		obj_feudal_milmonarchleader = {
			mil = 5
			is_monarch_leader = yes
		}
		obj_feudal_loyal_nobles = {
			allow = {
				has_dlc = "The Cossacks"
			}
			estate_loyalty = {
				estate = estate_nobles
				loyalty = 80
			}
		}	
		obj_feudal_legitimacy = {
			allow = {
				NOT = { has_dlc = "The Cossacks" }
			}
			legitimacy = 100
			government = feudal_monarchy
		}	
		obj_feudal_caliphate = {
			government = caliphate
		}
		obj_feudal_ports = {
			num_of_total_ports = 50
		}
		obj_feudal_infantry = {
			num_of_infantry = 50
		}
	}

	abilities = {
		ab_feudal_glorious_battles = {
			modifier = {
				prestige_from_land = 0.5
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_feudal_tax = {
			modifier = {
				vassal_income = 0.25
			}
			ai_will_do = {
				factor = 10
				modifier = {
					factor = 0
					NOT = { num_of_vassals = 1 }
				}
			}
		}
		ab_feudal_loyalty = {
			modifier = {
				reduced_liberty_desire = 10
			}
			ai_will_do = {
				factor = 10
				modifier = {
					factor = 0
					NOT = { num_of_vassals = 1 }
				}
			}
		}
		ab_feudal_mercenaries = {
			modifier = {
				merc_maintenance_modifier = -0.10
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_feudal_levies = {
			modifier = {
				vassal_forcelimit_bonus = 1
			}
			ai_will_do = {
				modifier = {
					factor = 0
					NOT = { num_of_vassals = 1 }
				}
			}
		}
		ab_feudal_military_duty = {
			modifier = {
				global_manpower_modifier = 0.10
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_feudal_law = {
			modifier = {
				stability_cost_modifier = -0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_feudal_norse_expeditions = {
			allow = {
				primary_culture = norwegian
			}
			modifier = {
				range = 0.33
				trade_range_modifier = 0.20
			}
			ai_will_do = {
				factor = 100
				modifier = {
					factor = 0
					NOT = { religion = norse_pagan_reformed }
				}
			}
		}
		ab_feudal_muslim_golden_age = {
			allow = {
				religion_group = muslim
				culture_group = turko_semitic
			}
			modifier = {
				global_institution_spread = 0.10
				technology_cost = -0.05
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_feudal_khitan_expansion = {
			allow = {
				primary_culture = khitan
			}
			modifier = {
				ae_impact = -0.15
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_feudal_pagan_defensiveness = {
			allow = {
				OR = {
					religion = romuva
					religion = slavic
					religion = suomenusko
				}
			}
			modifier = {
				hostile_attrition = 1
				defensiveness = 0.15
			}
			ai_will_do = {
				factor = 100
			}
		}
	}
}

high_middle_ages = {
	start = 1000
	
	can_start = {
		any_country = { adm_tech = 33 }
	}
	
	religious_conflicts = yes
	
	objectives = {
		obj_highmiddle_vassals = {
			vassal = 4
		}
		obj_highmiddle_jerusalem = {
			owns_core_province = 379
			379 = { religion = ROOT }
		}
		obj_highmiddle_defeat_religion_enemy = {
			custom_trigger_tooltip = {
				tooltip = defeat_rival_of_other_religion_group
				has_country_flag = won_against_rival_of_other_religion_group
			}
		}
		obj_highmiddle_piety = {
			uses_piety = yes
			piety = 0.8
		}
		obj_highmiddle_four_tournaments = {
			check_variable = {
				which = tournaments_held
				value = 4
			}
		}
		obj_highmiddle_workshops = {
			calc_true_if = {
				all_owned_province = {
					has_building = workshop
					controlled_by = owner
					is_core = ROOT
				}
				amount = 10
			}
		}
		obj_highmiddle_religious_unity = {
			religious_unity = 1
		}
	}

	abilities = {
		ab_highmiddle_religious_studies = {
			modifier = {
				tolerance_own = 2
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_highmiddle_crusaders = {
			modifier = {
				warscore_cost_vs_other_religion = -0.20
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_highmiddle_castles = {
			modifier = {
				fort_maintenance_modifier = -0.10
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_highmiddle_lasting_dynasty = {
			modifier = {
				heir_chance = 0.5
				legitimacy = 0.5
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_highmiddle_shock_tactics = {
			modifier = {
				shock_damage = 0.10
			}
			ai_will_do = {
				modifier = {
					factor = 0
					NOT = { num_of_vassals = 1 }
				}
			}
		}
		ab_highmiddle_knights = {
			modifier = {
				cavalry_power = 0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_highmiddle_fertile_farmlands = {
			modifier = {
				manpower_recovery_speed = 0.2
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_highmiddle_turkic_invasions = {
			allow = {
				primary_culture = turkish
			}
			modifier = {
				core_creation = -0.10
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_highmiddle_holy_roman_army = {
			allow = {
				is_part_of_hre = yes
				NOT = { government = theocratic_government }
			}
			modifier = {
				land_forcelimit_modifier = 0.25
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_highmiddle_byzantine_defences = {
			allow = {
				OR = {
					tag = BYZ
					tag = ROW
					tag = ROM
				}
			}
			modifier = {
				defensiveness = 0.20
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_highmiddle_influential_bishops = {
			allow = {
				government = theocratic_government
				religion = catholic
			}
			modifier = {
				papal_influence = 2
			}
			ai_will_do = {
				factor = 100
			}
		}
	}
}

late_middle_ages = {
	start = 1200
	
	can_start = {
		is_institution_enabled = guilds
	}
	
	religious_conflicts = yes
	
	objectives = {
		obj_latemiddle_pu = {
			personal_union  = 1
		}
		obj_latemiddle_elector = {
			is_elector = yes
		}
		obj_latemiddle_large_horde = {
			government = steppe_horde
			num_of_cities = 60
		}
		obj_latemiddle_papalcontrol = {
			religion = catholic
			is_papal_controller = yes
		}
		obj_latemiddle_docks = {
			calc_true_if = {
				all_owned_province = {
					has_building = dock
					controlled_by = owner
					is_core = ROOT
				}
				amount = 10
			}
		}
		obj_latemiddle_generals = {
			num_of_generals = 4
		}
		obj_latemiddle_large_trade_fleet = {
			all_rival_country = {
				NOT = {
					num_of_light_ship = ROOT
				}
			}
		}
	}

	abilities = {
		ab_latemiddle_legitimacy = {
			modifier = {
				legitimacy = 1	
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_latemiddle_trade = {
			modifier = {
				global_trade_power = 0.1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_latemiddle_missionary = {
			modifier = {
				missionaries = 1
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_latemiddle_proselytism = {
			modifier = {
				global_missionary_strength = 0.02
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_latemiddle_cheaper_mercenaries = {
			modifier = {
				merc_maintenance_modifier = -0.25
			}
			ai_will_do = {
				modifier = {
					factor = 0
					NOT = { num_of_vassals = 1 }
				}
			}
		}
		ab_latemiddle_state_administration = {
			modifier = {
				max_states = 2
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_latemiddle_careful_diplomacy = {
			modifier = {
				improve_relation_modifier = 0.25
			}
			ai_will_do = {
				factor = 10
			}
		}
		ab_latemiddle_steppe_cavalry = {
			allow = {
				culture_group = altaic
			}
			modifier = {
				cavalry_cost = -0.2
				cavalry_power = 0.1
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_latemiddle_merchant_fleets = {
			allow = {
				government = merchant_republic
			}
			modifier = {
				galley_power = 0.15
				light_ship_cost = -0.15
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_latemiddle_knightly_order = {
			allow = {
				government = monastic_order_government
			}
			modifier = {
				discipline = 0.05
			}
			ai_will_do = {
				factor = 100
			}
		}
		ab_latemiddle_delhi_architecture = {
			allow = {
				tag = DLH
			}
			modifier = {
				build_cost = -0.15
			}
			ai_will_do = {
				factor = 100
			}
		}
	}
}