﻿el_landed_camp_purpose_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = { has_realm_law = $CAMP_PURPOSE$ }
				add = 5
			}
		}
	}
}

el_landed_camp_purpose_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = { has_realm_law = $CAMP_PURPOSE$ }
				add = -5
			}
		}
	}
}


el_landed_education_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = { has_trait = education_$SKILL$_2 }
				add = 2
			}
			else_if = {
				limit = { has_trait = education_$SKILL$_3 }
				add = 4
			}
			else_if = {
				limit = { has_trait = education_$SKILL$_4 }
				add = 7
			}
			else_if = {
				limit = { has_trait = education_$SKILL$_5 }
				add = 10
			}
		}
	}
}

el_landed_education_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = { has_trait = education_$SKILL$_2 }
				add = -2
			}
			else_if = {
				limit = { has_trait = education_$SKILL$_3 }
				add = -4
			}
			else_if = {
				limit = { has_trait = education_$SKILL$_4 }
				add = -7
			}
			else_if = {
				limit = { has_trait = education_$SKILL$_5 }
				add = -10
			}
		}
	}
}

el_landed_intelect_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = { scope:$SCOPE$ = { has_trait =  intellect_good_1 } }
				add = 5
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_good_2 } }
				add = 10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_good_3 } }
				add = 15
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_bad_1 } }
				add = -5
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_bad_2 } }
				add = -10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_bad_3 } }
				add = -15
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = shrewd } }
				add = 10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = dull } }
				add = -10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = inbred } }
				add = -15
			}			
		}
	}							
}

el_landed_intelect_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = { scope:$SCOPE$ = { has_trait =  intellect_good_1 } }
				add = -5
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_good_2 } }
				add = -10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_good_3 } }
				add = -15
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_bad_1 } }
				add = 5
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_bad_2 } }
				add = 10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = intellect_bad_3 } }
				add = 15
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = shrewd } }
				add = -10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = dull } }
				add = 10
			}
			if = {
				limit = { scope:$SCOPE$ = { has_trait = inbred } }
				add = 15
			}				
		}
	}							
}

el_landed_con_nei_fervor_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			add = scope:el_employer.faith.fervor
			subtract = scope:el_landed_con_nei_fin.faith.fervor
			multiply = 0.3
		}
	}							
}

el_landed_con_nei_fervor_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			add = scope:el_employer.faith.fervor
			subtract = scope:el_landed_con_nei_fin.faith.fervor
			multiply = -0.3
		}
	}							
}

el_landed_con_nei_reformed_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					NOT = { scope:el_landed_con_nei_fin.faith = { has_doctrine_parameter = unreformed } }
				}
				add =  -10
			}
		}
	}							
}

el_landed_con_nei_reformed_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					NOT = { scope:el_landed_con_nei_fin.faith = { has_doctrine_parameter = unreformed } }
				}
				add =  10
			}
		}
	}							
}

el_landed_con_nei_cynical_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					scope:el_landed_con_nei_fin= { has_trait = cynical } 
				}
				add =  10
			}
		}
	}							
}

el_landed_con_nei_cynical_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					scope:el_landed_con_nei_fin= { has_trait = cynical } 
				}
				add =  -10
			}
		}
	}							
}

el_landed_con_nei_theologian_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					 has_trait = theologian 
				}
				add =  5
			}
		}
	}							
}

el_landed_con_nei_theologian_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					 has_trait = theologian 
				}
				add =  -5
			}
		}
	}							
}

el_landed_sup_fac_military_strenght_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			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_military_strenght_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			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_find_sec_lifestile_schemer_bonus_more_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					has_focus = intrigue_adventurer_focus
				}
				add = 2
			}
			if = {
				limit = {
					has_perk = digging_for_dirt_perk 
				}
				add = 5
			}
		}
	}
}

el_landed_find_sec_lifestile_schemer_bonus_less_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					has_focus = intrigue_adventurer_focus
				}
				add = -2
			}
			if = {
				limit = {
					has_perk = digging_for_dirt_perk 
				}
				add = -5
			}
		}
	}
}

el_landed_adventer_choose_success_modifier = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_train_knight }					
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_train_knight
			}
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_tutor_child }					
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_tutor_child
			}
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_des_nei }						
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_des_nei
			}
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_regale_court }					
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_regale_court
			}
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_imp_dom }						
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_imp_dom
			}
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_con_nei }						
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_con_nei
			}
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_sup_fac }					
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_sup_fac
			}
			if = {
				limit = {
					scope:el_employer = { has_character_flag = el_landed_propose_find_sec }					
				}
				min = scope:el_adventurer_fin.el_landed_chance_success_find_sec
			}
		}
	}
}

el_landed_adventer_choose_plague_modifier_plus = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					OR = {
						scope:el_employer.capital_province.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
									}
								}
							}
						}
						scope:el_employer.capital_province.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
									}
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
								}
							}
						}
					}
				}
				add = 50
			}
			if = {
				limit = {
					OR = {
						scope:el_employer.capital_province.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
										outbreak_intensity >= major
									}
								}
							}
						}
						scope:el_employer.capital_province.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
									outbreak_intensity >= major
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
										outbreak_intensity >= major
									}
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
									outbreak_intensity >= major
								}
							}
						}
					}
				}
				add = 50
			}
		}
	}
}

el_landed_adventer_choose_plague_modifier_moins = {
	modifier = {
		add = {
			value = 0
			if = {
				limit = {
					OR = {
						scope:el_employer.capital_province.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
									}
								}
							}
						}
						scope:el_employer.capital_province.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
									}
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
								}
							}
						}
					}
				}
				add = -50
			}
			if = {
				limit = {
					OR = {
						scope:el_employer.capital_province.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
										outbreak_intensity >= major
									}
								}
							}
						}
						scope:el_employer.capital_province.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
									outbreak_intensity >= major
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_neighboring_county = {
								any_county_province = {
									any_province_epidemic = {
										count >= 1
										outbreak_intensity >= major
									}
								}
							}
						}
						scope:el_adventurer_fin.location.county ?= {
							any_county_province = {
								any_province_epidemic = {
									count >= 1
									outbreak_intensity >= major
								}
							}
						}
					}
				}
				add = -50
			}
		}
	}
}