﻿#EK NOTE: perks grant xp on unlock for certain cultures

stalwart_leader_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 1 0 }
	icon = node_martial
	
	auto_selection_weight = {
		value = 11
		if = {
			limit = {
				has_education_martial_trigger = yes
			}
			add = 1989
		}
		if = {
			limit = {
				has_focus = martial_chivalry_focus
			}
			multiply = 5
		}
		if = {
			limit = {
				can_start_new_lifestyle_tree_trigger = no
			}
			multiply = 0
		}
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		trait_track_foot_xp_gain_mult = 0.2
	}

	character_modifier = {
		prowess = 4
		trait_track_foot_xp_gain_mult = 0.05
	}
	
	effect = {
		custom_description_no_bullet = {
			text = stalwart_leader_perk_effect
		}
		if = {
			limit = {
				NOT = { government_has_flag = government_is_nomadic }
			}
			custom_description_no_bullet = {
				text = unlock_dueling_rivals_effect
			}
		}
		else = {
			custom_description_no_bullet = {
				text = unlock_dueling_for_everyone_effect
			}
		}
		
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
				has_ep2_dlc_trigger = yes
			}	
			custom_tooltip = {
				text = adventurer_stalwart_leader_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
        if = {
            limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
            add_martial_lifestyle_xp = 330
        }
	}
}

courtship_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 0 1 }
	icon = node_martial

	parent = stalwart_leader_perk
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		courting_scheme_phase_duration_add = monumental_scheme_phase_duration_bonus_value
		elope_scheme_phase_duration_add = monumental_scheme_phase_duration_bonus_value
	}

	character_modifier = {
		courting_scheme_phase_duration_add = medium_scheme_phase_duration_bonus_value
		elope_scheme_phase_duration_add = medium_scheme_phase_duration_bonus_value
	}
	effect = {
		custom_description_no_bullet = {
			text = courtship_perk_effect
		}
		#EK ADDITION: xp for unlocking perk
        if = {
            limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
            add_martial_lifestyle_xp = 330
        }
	}
}

promising_prospects_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 0 2 }
	icon = node_martial

	parent = courtship_perk

	effect = {
		custom_description_no_bullet = {
			text = promising_prospects_perk_effect
		}
		#EK ADDITION: xp for unlocking perk
        if = {
            limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
            add_martial_lifestyle_xp = 330
        }	
	}
}

loyalty_and_respect_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 0 3 }
	icon = node_martial

	parent = promising_prospects_perk

	effect = {
		if = {
			limit = {
				NOT = { government_has_flag = government_is_landless_adventurer }
			}
			custom_description_no_bullet = {
				text = loyalty_and_respect_perk_stats_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_nomadic
			}
			custom_description_no_bullet = {
				text = loyalty_and_respect_perk_obedience_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
        if = {
            limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
            add_martial_lifestyle_xp = 330
        }
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		trait_track_wit_xp_gain_mult = 0.25
	}

	character_modifier = {
		spouse_opinion = 50
	}
}

chivalric_dominance_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 2 1 }
	icon = node_martial

	parent = stalwart_leader_perk

	government_character_modifier = {
		flag = government_is_administrative
		invert_check = yes
		knight_effectiveness_mult = 0.75
	}
	government_character_modifier = {
		flag = government_is_landless_adventurer
		invert_check = yes
		accolade_glory_gain_mult = 0.1
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		trait_track_horse_xp_gain_mult = 0.25
	}
	government_character_modifier = {
		flag = government_is_administrative
		same_heritage_county_advantage_add = 5
	}
	effect = {
		#EK ADDITION: xp for unlocking perk
		if = {
			limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
			add_martial_lifestyle_xp = 330
		}
	}
}

never_back_down_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 2 2 }
	icon = node_martial

	parent = chivalric_dominance_perk

	character_modifier = {
		advantage = 5
		hard_casualty_modifier = -0.2
		tourney_participant_xp_gain_mult = 0.1
	}
	effect = {
		#EK ADDITION: xp for unlocking perk
		if = {
			limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
			add_martial_lifestyle_xp = 330
		}
	}
}

kingsguard_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 2 3 }
	icon = node_martial

	parent = never_back_down_perk
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		trait_track_bow_xp_gain_mult = 0.25
	}

	government_character_modifier = {
		flag = government_is_administrative
		invert_check = yes
		knight_limit = 4
	}
	government_character_modifier = {
		flag = government_is_administrative
		knight_limit = 2
	}
	effect = {
		#EK ADDITION: xp for unlocking perk
		if = {
			limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
			add_martial_lifestyle_xp = 330
		}
	}
}

peacemaker_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 1 4 }
	icon = node_martial

	parent = loyalty_and_respect_perk
	parent = kingsguard_perk

	effect = {
		custom_description_no_bullet = {
			text = peacemaker_perk_effect
		}
		#EK ADDITION: xp for unlocking perk
		if = {
			limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
			add_martial_lifestyle_xp = 330
		}
	}
}

gallant_perk = {
	lifestyle = martial_lifestyle
	tree = chivalry
	position = { 1 5 }
	icon = trait_gallant
	
	parent = peacemaker_perk
	
	trait = gallant
	effect = {
		add_trait_force_tooltip = gallant
		#EK ADDITION: xp for unlocking perk
		if = {
			limit = { culture = { has_cultural_parameter = gallant_xp_rebate } }
			add_martial_lifestyle_xp = 500
		}
	}
}
