tr_est_chivalry_adopt = {
	custom_tooltip = tr_est_chivalry_adopt_desc
	unlocks_agenda = agenda_est_chivalry

	on_enabled = {
		hidden_effect = {
			every_owned_leader = {
				limit = {
					NOR = {
						has_trait =	leader_trait_admiral_est_chivalry
						has_trait =	leader_trait_official_est_chivalry
						has_trait =	leader_trait_scientist_est_chivalry
					}
				}
				if = {
					limit = { leader_class = commander }
					add_trait = { trait = leader_trait_admiral_est_chivalry }
				}
				if = {
					limit = { leader_class = official }
					add_trait = { trait = leader_trait_official_est_chivalry }
				}
				if = {
					limit = { leader_class = scientist }
					add_trait = { trait = leader_trait_scientist_est_chivalry }
				}
			}
			every_pool_leader = {
				limit = {
					NOR = {
						has_trait =	leader_trait_admiral_est_chivalry
						has_trait =	leader_trait_official_est_chivalry
						has_trait =	leader_trait_scientist_est_chivalry
					}
				}
				if = {
					limit = { leader_class = commander }
					add_trait = { trait = leader_trait_admiral_est_chivalry }
				}
				if = {
					limit = { leader_class = official }
					add_trait = { trait = leader_trait_official_est_chivalry }
				}
				if = {
					limit = { leader_class = scientist }
					add_trait = { trait = leader_trait_scientist_est_chivalry }
				}
			}
		}
	}
}


tr_est_chivalry_finish = {
	custom_tooltip = tr_est_chivalry_finish_desc

	on_enabled = {
		country_event = {
			id = est_chivalry.8
		}
	}

	modifier = {	
		ascension_perks_add = 1
	}

	tradition_swap = {
		name = tr_est_chivalry_finish_AI
		inherit_icon = yes
		inherit_name = yes
		trigger = { is_ai = yes }	
		modifier = {	
			ruler_skill_add = 2 # Metallichydra: Changed from skill levels to skill add
			ascension_perks_add = 1
		}
		weight = {factor = 1 }
	}
}


tr_est_chivalry_1 = {
	modifier = {
		ship_fire_rate_mult = 0.10
	}
	ai_weight = { factor = 5000 }
}

tr_est_chivalry_2 = {
	custom_tooltip = tr_est_chivalry_2_desc

	possible = { has_tradition = tr_est_chivalry_1 }
	
	modifier = {
		country_trust_growth = 0.30
	}
	
	tradition_swap = {
		name = tr_est_chivalry_2_no_dip
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			OR = {
				has_civic = civic_inwards_perfection
				has_civic = civic_fanatic_purifiers
			}
		}	
		modifier = {
			pop_happiness = 0.05
		}
		weight = {factor = 2 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_chivalry_3 = {
	possible = { has_tradition = tr_est_chivalry_2 }
	
	modifier = {
		country_war_exhaustion_mult = -0.10
	}
	ai_weight = { factor = 5000 }
}

tr_est_chivalry_4 = {
	possible = { has_tradition = tr_est_chivalry_2	 }
	
	modifier = {
		armies_upkeep_mult = -0.15
		armies_cost_mult = -0.15
		army_morale = 0.25
	}

	ai_weight = { factor = 5000 }
}

tr_est_chivalry_5 = {
	custom_tooltip = tr_est_chivalry_5_desc

	possible = { has_tradition = tr_est_chivalry_4 }
	
	ai_weight = { factor = 5000 }
}