﻿el_squared_distance_camp = 45000
el_squared_distance_max_travel = 250000

el_landed_chance_success_intelect = {
	value = 0
	if = {
		limit = {  has_trait =  intellect_good_1 } 
		add = 5
	}
	if = {
		limit = {  has_trait = intellect_good_2 } 
		add = 10
	}
	if = {
		limit = {  has_trait = intellect_good_3 } 
		add = 15
	}
	if = {
		limit = {  has_trait = intellect_bad_1 } 
		add = -5
	}
	if = {
		limit = {  has_trait = intellect_bad_2 } 
		add = -10
	}
	if = {
		limit = {  has_trait = intellect_bad_3 } 
		add = -15
	}
	if = {
		limit = {  has_trait = shrewd } 
		add = 10
	}
	if = {
		limit = {  has_trait = dull } 
		add = -10
	}
	if = {
		limit = {  has_trait = inbred } 
		add = -15
	}	
}

el_landed_el_landed_chance_success_education_diplomacy = {
	value = 0
	if = {
		limit = { has_trait = education_diplomacy_2 }
		add = 2
	}
	else_if = {
		limit = { has_trait = education_diplomacy_3 }
		add = 4
	}
	else_if = {
		limit = { has_trait = education_diplomacy_4 }
		add = 7
	}
	else_if = {
		limit = { has_trait = education_diplomacy_5 }
		add = 10
	}
}

el_landed_el_landed_chance_success_education_martial = {
	value = 0
	if = {
		limit = { has_trait = education_martial_2 }
		add = 2
	}
	else_if = {
		limit = { has_trait = education_martial_3 }
		add = 4
	}
	else_if = {
		limit = { has_trait = education_martial_4 }
		add = 7
	}
	else_if = {
		limit = { has_trait = education_martial_5 }
		add = 10
	}
}

el_landed_el_landed_chance_success_education_stewardship = {
	value = 0
	if = {
		limit = { has_trait = education_stewardship_2 }
		add = 2
	}
	else_if = {
		limit = { has_trait = education_stewardship_3 }
		add = 4
	}
	else_if = {
		limit = { has_trait = education_stewardship_4 }
		add = 7
	}
	else_if = {
		limit = { has_trait = education_stewardship_5 }
		add = 10
	}
}

el_landed_el_landed_chance_success_education_intrigue = {
	value = 0
	if = {
		limit = { has_trait = education_intrigue_2 }
		add = 2
	}
	else_if = {
		limit = { has_trait = education_intrigue_3 }
		add = 4
	}
	else_if = {
		limit = { has_trait = education_intrigue_4 }
		add = 7
	}
	else_if = {
		limit = { has_trait = education_intrigue_5 }
		add = 10
	}
}

el_landed_el_landed_chance_success_education_learning = {
	value = 0
	if = {
		limit = { has_trait = education_learning_2 }
		add = 2
	}
	else_if = {
		limit = { has_trait = education_learning_3 }
		add = 4
	}
	else_if = {
		limit = { has_trait = education_learning_4 }
		add = 7
	}
	else_if = {
		limit = { has_trait = education_learning_5 }
		add = 10
	}
}


el_landed_chance_success_train_knight = {
	value = 50
	add = {
		value = {
			add = {
				value = martial
				subtract = high_skill_rating
				multiply = 3.5
				divide = 2
			}
			add = {	
				value = prowess
				subtract = high_skill_rating
				multiply = 3.5
				divide = 2				
			}
		}
	}
	add = {
		value = el_landed_chance_success_intelect
	}
	add = {
		value = el_landed_el_landed_chance_success_education_martial
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_mercenaries
		}
		add = 5
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_brigands
		}
		add = 5
	}
}

el_landed_chance_success_tutor_child = {
	value = 50
	add = {
		value = learning
		subtract = high_skill_rating
		multiply = 3.5
	}
	add = {
		value = el_landed_chance_success_intelect
	}
	add = {
		value = el_landed_el_landed_chance_success_education_learning
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_scholars
		}
		add = 5
	}
}

el_landed_chance_success_des_nei = {
	value = 50
	add = {
		value = {
			add = {
				value = intrigue
				subtract = high_skill_rating
				multiply = 3.5
				divide = 2
			}
			add = {	
				value = prowess
				subtract = high_skill_rating
				multiply = 3.5
				divide = 2				
			}
		}
	}
	add = {
		value = el_landed_chance_success_intelect
	}
	add = {
		value = el_landed_el_landed_chance_success_education_intrigue
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_mercenaries
		}
		add = 5
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_brigands
		}
		add = 5
	}
	if = {
		limit = {
			has_trait = gallowsbait
		}
		add = 5
	}
}

el_landed_chance_success_regale_court = {
	value = 50
	add = {
		value = diplomacy
		subtract = high_skill_rating
		multiply = 3.5
	}
	add = {
		value = el_landed_chance_success_intelect
	}
	add = {
		value = el_landed_el_landed_chance_success_education_diplomacy
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_explorers
		}
		add = 5
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_legitimists
		}
		add = 10
	}
	if = {
		limit = {
			has_trait = lifestyle_reveler
		}
		add = 5
	}
}

el_landed_chance_success_imp_dom = {
	value = 50
	add = {
		value = stewardship
		subtract = high_skill_rating
		multiply = 3.5
	}
	add = {
		value = el_landed_chance_success_intelect
	}
	add = {
		value = el_landed_el_landed_chance_success_education_stewardship
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_scholars
		}
		add = 5
	}
}

el_landed_chance_success_con_nei = {
	value = 50
	add = {
		value = learning
		subtract = very_high_skill_rating
		multiply = 3.5
	}
	add = {
		value = el_landed_chance_success_intelect
	}
	add = {
		value = el_landed_el_landed_chance_success_education_learning
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_scholars
		}
		add = 5
	}
	if = {
		limit = {
			 has_trait = theologian
		}
		add = 5
	}
	add = {
		value = -5
	}
}

el_landed_chance_success_sup_fac = {
	value = 50
	add = {
		value = martial
		subtract = high_skill_rating
		multiply = 3.5
	}
	add = {
		value = el_landed_chance_success_intelect
	}
	add = {
		value = el_landed_el_landed_chance_success_education_martial
	}
	if = {
		limit = {
			has_realm_law = camp_purpose_mercenaries
		}
		add = 5
	}
	if = {
		limit = {
			max_military_strength <= 250
		}
		add = -15
	}
	else_if = {
		limit = {
			max_military_strength > 250
			max_military_strength <= 500
		}
		add = -5
	}
	else_if = {
		limit = {
			max_military_strength > 500
			max_military_strength <= 1000
		}
		add = 0
	}
	else_if = {
		limit = {
			max_military_strength > 1000
			max_military_strength <= 2000
		}
		add = 5	
	}
	else_if = {
		limit = {
			max_military_strength > 2000
		}
		add = 10
	}
}

el_landed_sup_fac_levie_maa_value = {
	value = 0
	if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength <= 250
		}
		add = 200
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 250
			scope:el_adventurer_fin.max_military_strength <= 500
		}
		add = 350
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 500
			scope:el_adventurer_fin.max_military_strength <= 1000
		}
		add = 750
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 1000
			scope:el_adventurer_fin.max_military_strength <= 2000
		}
		add = 1000
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 2000
		}
		add = 1500
	}
}

el_landed_sup_fac_levie_discont_value = {
	value = 0
	if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength <= 250
		}
		add = 0
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 250
			scope:el_adventurer_fin.max_military_strength <= 500
		}
		add = 10
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 500
			scope:el_adventurer_fin.max_military_strength <= 1000
		}
		add = 20
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 1000
			scope:el_adventurer_fin.max_military_strength <= 2000
		}
		add = 30
	}
	else_if = {
		limit = {
			scope:el_adventurer_fin.max_military_strength > 2000
		}
		add = 50
	}
}




