#On-action combat event: Killed in action
character_event = {
	id = 242
	desc = EVTDESC242	
	picture = GFX_evt_death
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = berserker }
	}

	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.1
			trait = immortal
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = clubfooted
			factor = 1.25
		}
		modifier = {
			trait = hunchback
			factor = 1.25
		}
		modifier = {
			trait = lisp
			factor = 1.1
		}
		modifier = {
			trait = stutter
			factor = 1.1
		}
		modifier = {
			trait = dwarf
			factor = 1.25
		}		
		modifier = {
			trait = genius
			factor = 0.9
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 0.9
		}	
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 2.0
		}
		
		modifier = {
			trait = imbecile
			factor = 3.0
		}
		modifier = {
			trait = inbred
			factor = 3.0
		}
		modifier = {
			is_strong_trigger = yes
			factor = 0.7
		}
		modifier = {
			is_weak_trigger = yes
			factor = 2.5
		}		
		modifier = {
			factor = 1.25
			trait = stressed
		}
		modifier = {
			factor = 1.5
			trait = depressed
		}
		modifier = {
			factor = 3.0
			trait = lunatic
		}
		modifier = {
			factor = 2.0
			trait = possessed
		}
		modifier = {
			factor = 1.1
			is_ill = yes
		}
		modifier = {
			factor = 1.15
			trait = pneumonic
		}
		modifier = {
			factor = 1.15
			trait = syphilitic
		}
		modifier = {
			factor = 2.0
			trait = leper
		}
		modifier = {
			factor = 1.15
			trait = wounded
		}
		modifier = {
			factor = 1.25
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 2.0
			trait = infirm
		}
		modifier = {
			factor = 3.0
			trait = incapable
		}
		modifier = {
			factor = 1.1
			trait = drunkard
		}
		modifier = {
			factor = 1.1
			trait = has_tuberculosis
		}
		modifier = {
			factor = 1.1
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 1.5
			trait = has_typhus
		}
		modifier = {
			factor = 1.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 1.1
			trait = has_measles
		}		
		modifier = {
			factor = 1.1
			trait = has_small_pox
		}		
	}
	
	immediate = {
		liege = {
			if = {
				limit = { NOT = { character = ROOT } }
				character_event = { id = 253 }
			}
		}
		#check for chance of martyr trait during crusade/jihad
		if = {
			limit = {
				religion_group = christian
				NOT = { religion_group = FROMFROM }
				is_heretic = no
				piety = 25
				OR = {
					AND = {
						has_called_crusade = yes
						OR = {
							any_war = {
								attacker = { religion = ROOT }
								defender = { religion = FROMFROM }
								using_cb = crusade
							}
							any_liege = {
								any_war = {
									attacker = { religion = ROOT }
									defender = { religion = FROMFROM }
									using_cb = crusade
								}
							}
						}
					}
					AND = {
						FROMFROM = { has_called_crusade = yes }
						OR = {
							any_war = {
								attacker = { religion = FROMFROM }
								defender = { religion = ROOT }
								using_cb = crusade
							}
							any_liege = {
								any_war = {
									attacker = { religion = FROMFROM }
									defender = { religion = ROOT }
									using_cb = crusade
								}
							}
						}
					}
					any_war = {
						attacker = { religion = ROOT }
						defender = { religion = FROMFROM }
						OR = {
							using_cb = holy_war
							using_cb = religious_revolt
						}
					}
					any_liege = {
						any_war = {
							attacker = { religion = ROOT }
							defender = { religion = FROMFROM }
							OR = {
								using_cb = holy_war
								using_cb = religious_revolt
							}
						}
					}
					any_war = {
						attacker = { religion = FROMFROM }
						defender = { religion = ROOT }
						using_cb = holy_war
					}
					any_liege = {
						any_war = {
							attacker = { religion = FROMFROM }
							defender = { religion = ROOT }
							using_cb = holy_war
						}
					}
				}
				OR = {
					NOT = { trait = possessed }
					has_character_modifier = voice_of_jesus
				}
				NOR = {
					trait = lunatic
					trait = hedonist
					trait = craven
					trait = cynical
					trait = excommunicated
					is_kinslayer_trigger = yes
					trait = homosexual
					trait = bad_priest_christian
					has_character_modifier = voice_of_satan
				}
			}
			random = {
				chance = 25
				modifier = {
					factor = 5
					has_character_modifier = voice_of_jesus
				}
				modifier = {
					factor = 2.5
					is_ruler = yes
					is_theocracy = yes
				}
				modifier = {
					factor = 2.5
					OR = {
						trait = celibate
						trait = monk
						trait = nun
					}
				}
				modifier = {
					factor = 2
					trait = zealous
				}
				modifier = {
					factor = 1.5
					trait = chaste
				}
				modifier = {
					factor = 1.5
					trait = kind
				}
				modifier = {
					factor = 1.5
					trait = humble
				}
				modifier = {
					factor = 1.5
					trait = brave
				}
				modifier = {
					factor = 1.25
					trait = temperate
				}
				modifier = {
					factor = 1.25
					trait = charitable
				}
				modifier = {
					factor = 1.25
					trait = patient
				}
				modifier = {
					factor = 1.25
					trait = honest
				}
				modifier = {
					factor = 1.25
					trait = just
				}
				modifier = {
					factor = 0.75
					trait = lustful
				}
				modifier = {
					factor = 0.75
					trait = gluttonous
				}
				modifier = {
					factor = 0.75
					trait = greedy
				}
				modifier = {
					factor = 0.75
					trait = envious
				}
				modifier = {
					factor = 0.75
					trait = cruel
				}
				modifier = {
					factor = 0.75
					trait = proud
				}
				modifier = {
					factor = 0.75
					trait = deceitful
				}
				modifier = {
					factor = 0.75
					trait = arbitrary
				}
				modifier = {
					factor = 0.5
					NOT = { piety = 50 }
				}
				modifier = {
					factor = 1.1
					piety = 100
				}
				modifier = {
					factor = 1.1
					piety = 200
				}
				modifier = {
					factor = 1.2
					piety = 300
				}
				modifier = {
					factor = 1.2
					piety = 400
				}
				modifier = {
					factor = 1.3
					piety = 500
				}
				modifier = {
					factor = 1.5
					piety = 1000
				}
				modifier = {
					factor = 0.5
					NOR = {
						has_called_crusade = yes
						FROMFROM = { has_called_crusade = yes }
					}
				}
				log = "[Root.GetBestName] has been declared a [Root.Religion.GetName] martyr"
				add_trait = martyr
				if = {
					limit = { has_nickname = no }
					give_nickname = nick_the_martyr
				}
				FROMFROM = { save_event_target_as = martyr_killer }
				save_event_target_as = new_martyr
				any_dynasty_member = {
					limit = {
						NOT = { character = FROMFROM }
						NOT = { character = FROM }
					}
					character_event = { id = Plus.2600 days = 1 random = 13 }
				}
				any_liege = {
					limit = {
						NOT = { character = FROMFROM }
						NOT = { character = FROM }
						NOT = { dynasty = ROOT }
					}
					character_event = { id = Plus.2600 days = 1 random = 13 }
				}
				any_spouse = {
					limit = {
						NOT = { character = FROMFROM }
						NOT = { character = FROM }
						NOT = { dynasty = ROOT }
						NOT = { is_vassal_or_below = ROOT }
					}
					character_event = { id = Plus.2600 days = 1 random = 13 }
				}
			}
		}
		FROMFROM = {
			if = {
				limit = { 
					NOR = { 
						is_vassal_or_below = ROOT
						character = ROOT
					}
				}
				set_character_flag = temp_battle_kill_242
				character_event = { id = 249 }
			}
		}
		FROM = {
			if = {
				limit = { 
					NOR = { 
						has_character_flag = temp_battle_kill_242
						is_vassal_or_below = ROOT
						character = ROOT
					}
				}
				character_event = { id = 249 }
			}
		}
		FROMFROM = {
			clr_character_flag = temp_battle_kill_242
		}
		if = {
			limit = {
				OR = {
					is_liege_or_above = FROM
					FROM = { character = ROOT }
					NOT = { FROM = { always = yes } }
				}
			}
			death = {
				death_reason = death_battle
			}
			break = yes
		}
		death = {
			death_reason = death_battle
			killer = FROM
		}
	}
	
	option = {
		name = ALAS
	}	
}

#On-action combat event: Wounded in action
character_event = {
	id = 243
	desc = EVTDESC243
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		NOT = { trait = wounded }
		can_be_maimed_trigger = yes
		NOT = { trait = berserker }
		is_alive = yes
		immortal = no
	}
	
	weight_multiplier = {
		days = 1
		
		modifier = {
			factor = 5
			has_character_modifier = proving_bravery
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = clubfooted
			factor = 1.25
		}
		modifier = {
			trait = hunchback
			factor = 1.25
		}
		modifier = {
			trait = lisp
			factor = 1.1
		}
		modifier = {
			trait = stutter
			factor = 1.1
		}
		modifier = {
			trait = dwarf
			factor = 1.25
		}		
		modifier = {
			trait = genius
			factor = 0.9
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 0.9
		}	
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 2.0
		}
		
		modifier = {
			trait = imbecile
			factor = 3.0
		}
		modifier = {
			trait = inbred
			factor = 3.0
		}
		modifier = {
			is_strong_trigger = yes
			factor = 0.7
		}
		modifier = {
			is_weak_trigger = yes
			factor = 2.5
		}		
		
		modifier = {
			factor = 1.25
			trait = stressed
		}
		modifier = {
			factor = 1.5
			trait = depressed
		}
		modifier = {
			factor = 3.0
			trait = lunatic
		}
		modifier = {
			factor = 2.0
			trait = possessed
		}
		modifier = {
			factor = 1.1
			is_ill = yes
		}
		modifier = {
			factor = 1.15
			trait = pneumonic
		}
		modifier = {
			factor = 1.15
			trait = syphilitic
		}
		modifier = {
			factor = 2.0
			trait = leper
		}
		modifier = {
			factor = 1.25
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 2.0
			trait = infirm
		}
		modifier = {
			factor = 3.0
			trait = incapable
		}
		modifier = {
			factor = 1.1
			trait = drunkard
		}
		modifier = {
			factor = 1.1
			trait = has_tuberculosis
		}
		modifier = {
			factor = 1.1
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 1.5
			trait = has_typhus
		}
		modifier = {
			factor = 1.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 1.1
			trait = has_measles
		}		
		modifier = {
			factor = 1.1
			trait = has_small_pox
		}		
		
	}
	
	option = {
		name = CURSES
		add_trait = wounded
		if = {
			limit = {
				is_ruler = yes
				religion_group = muslim
			}
			piety = 10
		}
	}
}

#On-action combat event: Maimed in action
character_event = {
	id = 244
	desc = EVTDESC244
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war

	is_triggered_only = yes
	
	
	trigger = {
		NOT = { trait = maimed }
		NOT = { trait = mangled }
		NOT = { 
			AND = {
				trait = one_eyed
				trait = one_handed 
				trait = one_legged 
				trait = disfigured 
			}
		}
		NOT = { trait = berserker }
		is_alive = yes
		immortal = no
	}
	
	weight_multiplier = {
		days = 1
		
		modifier = {
			factor = 5
			has_character_modifier = proving_bravery
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = clubfooted
			factor = 1.25
		}
		modifier = {
			trait = hunchback
			factor = 1.25
		}
		modifier = {
			trait = lisp
			factor = 1.1
		}
		modifier = {
			trait = stutter
			factor = 1.1
		}
		modifier = {
			trait = dwarf
			factor = 1.25
		}		
		modifier = {
			trait = genius
			factor = 0.9
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 0.9
		}	
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 2.0
		}
		
		modifier = {
			trait = imbecile
			factor = 3.0
		}
		modifier = {
			trait = inbred
			factor = 3.0
		}
		modifier = {
			is_strong_trigger = yes
			factor = 0.7
		}
		modifier = {
			is_weak_trigger = yes
			factor = 2.5
		}		

		modifier = {
			factor = 1.25
			trait = stressed
		}
		modifier = {
			factor = 1.5
			trait = depressed
		}
		modifier = {
			factor = 3.0
			trait = lunatic
		}
		modifier = {
			factor = 2.0
			trait = possessed
		}
		modifier = {
			factor = 1.1
			is_ill = yes
		}
		modifier = {
			factor = 1.15
			trait = pneumonic
		}
		modifier = {
			factor = 1.15
			trait = syphilitic
		}
		modifier = {
			factor = 2.0
			trait = leper
		}
		modifier = {
			factor = 1.15
			trait = wounded
		}
		modifier = {
			factor = 2.0
			trait = infirm
		}
		modifier = {
			factor = 3.0
			trait = incapable
		}
		modifier = {
			factor = 1.1
			trait = drunkard
		}
		modifier = {
			factor = 1.1
			trait = has_tuberculosis
		}
		modifier = {
			factor = 1.1
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 1.5
			trait = has_typhus
		}
		modifier = {
			factor = 1.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 1.1
			trait = has_measles
		}		
		modifier = {
			factor = 1.1
			trait = has_small_pox
		}		

	}
	
	option = {
		name = CURSES
		add_maimed_trait_effect = yes
		if = {
			limit = {
				is_ruler = yes
				religion_group = muslim
			}
			piety = 10
		}
	}
}

#On-action combat event: Serious head injury in action
character_event = {
	id = 245
	#desc = EVTDESC245
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	desc = {
		picture = GFX_evt_battle
		text = EVTDESC245
		trigger = { has_character_flag = wounded_incapable }
	}
	desc = {
		picture = GFX_evt_battle
		text = 245.d2
		trigger = { has_character_flag = wounded_disfigured }
	}

	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				has_dlc = "Reapers"
			}
			random_list = {
				60 = {
					modifier = {
						factor = 0
						trait = disfigured						
					}
					set_character_flag = wounded_disfigured
				}
				40 = {
					set_character_flag = wounded_incapable
				}
			}
		}
	}
	
	
	trigger = {
		NOT = { trait = incapable }
		immortal = no
		is_alive = yes
	}
	
	weight_multiplier = {
		days = 1
		
		modifier = {
			factor = 5
			has_character_modifier = proving_bravery
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
		
			trait = craven
		}
		modifier = {
			trait = clubfooted
			factor = 1.25
		}
		modifier = {
			trait = hunchback
			factor = 1.25
		}
		modifier = {
			trait = lisp
			factor = 1.1
		}
		modifier = {
			trait = stutter
			factor = 1.1
		}
		modifier = {
			trait = dwarf
			factor = 1.25
		}		
		modifier = {
			trait = genius
			factor = 0.9
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 0.9
		}	
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 2.0
		}
		modifier = {
			trait = imbecile
			factor = 3.0
		}
		modifier = {
			trait = inbred
			factor = 3.0
		}
		modifier = {
			is_strong_trigger = yes
			factor = 0.7
		}
		modifier = {
			is_weak_trigger = yes
			factor = 2.5
		}
		modifier = {
			factor = 1.25
			trait = stressed
		}
		modifier = {
			factor = 1.5
			trait = depressed
		}
		modifier = {
			factor = 1.5
			trait = lunatic
		}
		modifier = {
			factor = 2.0
			trait = possessed
		}
		modifier = {
			factor = 1.1
			is_ill = yes
		}
		modifier = {
			factor = 1.15
			trait = pneumonic
		}
		modifier = {
			factor = 1.15
			trait = syphilitic
		}
		modifier = {
			factor = 2.0
			trait = leper
		}
		modifier = {
			factor = 1.15
			trait = wounded
		}
		modifier = {
			factor = 1.25
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 2.0
			trait = infirm
		}
		modifier = {
			factor = 1.1
			trait = drunkard
		}
		modifier = {
			factor = 1.1
			trait = has_tuberculosis
		}
		modifier = {
			factor = 1.1
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 1.5
			trait = has_typhus
		}
		modifier = {
			factor = 1.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 1.1
			trait = has_measles
		}
		modifier = {
			factor = 1.1
			trait = has_small_pox
		}
	}

	option = {
		name = CURSES
		if = {
			limit = {
				NOT = {
					has_dlc = "Reapers"
				}
			}
			add_trait = incapable
			break = yes
		}
		if = {
			limit = {
				has_dlc = "Reapers"
				has_character_flag = wounded_disfigured
			}
			add_trait = disfigured 
			add_trait = severely_injured 
			resolve_severely_injured_effect = yes
			clr_character_flag = wounded_disfigured
			break = yes
		}
		if = {
			limit = {
				has_character_flag = wounded_incapable
			}
			add_trait = incapable
			clr_character_flag = wounded_incapable
		}
		if = {
			limit = {
				is_ruler = yes
				religion_group = muslim
			}
			piety = 10
		}
	}
}

#On-action combat event: Character skill improves
character_event = {
	id = 246
	desc = EVTDESC246
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		is_alive = yes
		OR = {
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
		}
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = genius
			factor = 1.2
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.1
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.9
		}
		
		modifier = {
			trait = imbecile
			factor = 0.2
		}
		modifier = {
			trait = inbred
			factor = 0.2
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.5
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}
		modifier = {
			factor = 0.9
			trait = stressed
		}
		modifier = {
			factor = 0.8
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.75
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.8
			trait = pneumonic
		}
		modifier = {
			factor = 0.8
			trait = syphilitic
		}
		modifier = {
			factor = 0.5
			trait = leper
		}
		modifier = {
			factor = 0.9
			trait = wounded
		}
		modifier = {
			factor = 0.8
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 0.5
			trait = infirm
		}
		modifier = {
			factor = 0.4
			trait = incapable
		}
		modifier = {
			factor = 0.5
			trait = drunkard
		}
		modifier = {
			factor = 0.5
			trait = has_tuberculosis
		}
		modifier = {
			factor = 0.5
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 0.5
			trait = has_typhus
		}
		modifier = {
			factor = 0.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 0.5
			trait = has_measles
		}
		modifier = {
			factor = 0.5
			trait = has_small_pox
		}
	}

	option = {
		name = EXCELLENT
		if = {
			limit = {
				trait = skilled_tactician
			}
			remove_trait = skilled_tactician
			add_trait = brilliant_strategist
		}
		if = {
			limit = {
				trait = tough_soldier
			}
			remove_trait = tough_soldier
			add_trait = skilled_tactician
		}
		if = {
			limit = {
				trait = misguided_warrior
			}
			remove_trait = misguided_warrior
			add_trait = tough_soldier
		}
		if = {
			limit = {
				is_ruler = yes
				religion_group = muslim
			}
			piety = 10
		}
	}
}

#On-action combat event: Flat improvement to martial skill
character_event = {
	id = 247
	desc = EVTDESC247
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	notification = yes

	trigger = {
		is_alive = yes
		NOT = { martial = 20 }
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = genius
			factor = 1.2
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.1
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.9
		}
		modifier = {
			trait = imbecile
			factor = 0.2
		}
		modifier = {
			trait = inbred
			factor = 0.2
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.5
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}
		modifier = {
			factor = 0.9
			trait = stressed
		}
		modifier = {
			factor = 0.8
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.75
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.8
			trait = pneumonic
		}
		modifier = {
			factor = 0.8
			trait = syphilitic
		}
		modifier = {
			factor = 0.5
			trait = leper
		}
		modifier = {
			factor = 0.9
			trait = wounded
		}
		modifier = {
			factor = 0.8
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 0.5
			trait = infirm
		}
		modifier = {
			factor = 0.4
			trait = incapable
		}
		modifier = {
			factor = 0.5
			trait = drunkard
		}
		modifier = {
			factor = 0.5
			trait = has_tuberculosis
		}
		modifier = {
			factor = 0.5
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 0.5
			trait = has_typhus
		}
		modifier = {
			factor = 0.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 0.5
			trait = has_measles
		}
		modifier = {
			factor = 0.5
			trait = has_small_pox
		}
	}
	
	immediate = {
		change_martial = 1
	}

	option = {
		name = EXCELLENT
		if = {
			limit = {
				is_ruler = yes
				religion_group = muslim
			}
			piety = 10
		}
	}
}

#On-action combat event: Tech Increase in Capital
character_event = {
	id = 248
	desc = EVTDESC248
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
		is_landed = yes
		OR = {
			trait = brilliant_strategist
			trait = skilled_tactician
		}
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 3
			has_focus = focus_scholarship
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = genius
			factor = 3.0
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 2.0
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.1
		}

		modifier = {
			trait = imbecile
			factor = 0
		}
		modifier = {
			trait = inbred
			factor = 0.2
		}
		modifier = {
			factor = 0.9
			trait = stressed
		}
		modifier = {
			factor = 0.8
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.75
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.8
			trait = pneumonic
		}
		modifier = {
			factor = 0.8
			trait = syphilitic
		}
		modifier = {
			factor = 0.5
			trait = leper
		}
		modifier = {
			factor = 0.9
			trait = wounded
		}
		modifier = {
			factor = 0.8
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 0.5
			trait = infirm
		}
		modifier = {
			factor = 0.4
			trait = incapable
		}
		modifier = {
			factor = 0.5
			trait = drunkard
		}
		modifier = {
			factor = 0.5
			trait = has_tuberculosis
		}
		modifier = {
			factor = 0.5
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 0.5
			trait = has_typhus
		}
		modifier = {
			factor = 0.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 0.5
			trait = has_measles
		}
		modifier = {
			factor = 0.5
			trait = has_small_pox
		}
	}

	option = {
		name = EXCELLENT
		capital_scope = {
			add_province_modifier = {
				name = war_knowledge
				duration = 365
			}
		}
	}
}

#Opponent is informed that enemy commander has been killed
character_event = {
	id = 249
	desc = EVTDESC249
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
	}

	option = {
		name = EVTOPTA249
	}
}

#Opponent is informed that enemy commander has been killed
character_event = {
	id = 253
	desc = EVTDESC253
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
	}

	option = {
		name = ALAS
	}
}

#On-action combat event: Becoming Brave
character_event = {
	id = 270
	desc = EVTDESC270
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
		NOT = { trait = brave }
		NOT = { trait = craven }
		immortal = no
	}
	
	weight_multiplier = {
		days = 1
		
		modifier = {
			factor = 5
			has_character_modifier = proving_bravery
		}
		modifier = {
			trait = genius
			factor = 1.2
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.1
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.9
		}
		
		modifier = {
			trait = imbecile
			factor = 0.2
		}
		modifier = {
			trait = inbred
			factor = 0.2
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.5
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}
		modifier = {
			factor = 0.9
			trait = stressed
		}
		modifier = {
			factor = 0.8
			trait = depressed
		}
		modifier = {
			factor = 0.75
			trait = lunatic
		}
		modifier = {
			factor = 0.75
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.8
			trait = pneumonic
		}
		modifier = {
			factor = 0.8
			trait = syphilitic
		}
		modifier = {
			factor = 0.5
			trait = leper
		}
		modifier = {
			factor = 0.9
			trait = wounded
		}
		modifier = {
			factor = 0.8
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 0.5
			trait = infirm
		}
		modifier = {
			factor = 0.4
			trait = incapable
		}
		modifier = {
			factor = 0.5
			trait = drunkard
		}
		modifier = {
			factor = 0.5
			trait = has_tuberculosis
		}
		modifier = {
			factor = 0.5
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 0.5
			trait = has_typhus
		}
		modifier = {
			factor = 0.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 0.5
			trait = has_measles
		}
		modifier = {
			factor = 0.5
			trait = has_small_pox
		}

	}

	option = {
		name = EXCELLENT
		add_trait = brave

		random = {
			chance = 50
			#Promote battle trait
			if = {
				limit = {
					trait = skilled_warrior
					NOT = { has_character_flag = promoted_cta }
				}
				add_trait = master_warrior
				set_character_flag = promoted_cta
			}
			if = {
				limit = { 
					trait = trained_warrior
					NOT = { has_character_flag = promoted_cta }
				}
				add_trait = skilled_warrior
				set_character_flag = promoted_cta
			}
			if = {
				limit = {
					trait = poor_warrior
					NOT = { has_character_flag = promoted_cta }
				}
				add_trait = trained_warrior
				set_character_flag = promoted_cta
			}
			if = {
				limit = {
					NOT = { trait = poor_warrior }
					NOT = { trait = trained_warrior }
					NOT = { trait = skilled_warrior }
					NOT = { trait = master_warrior }
					NOT = { has_character_flag = promoted_cta }
				}
				add_trait = poor_warrior
				set_character_flag = promoted_cta
			}
			hidden_tooltip = { clr_character_flag = promoted_cta }
		}
		if = {
			limit = {
				is_ruler = yes
				religion_group = muslim
			}
			piety = 10
		}
	}
}

#On-action combat event: Becoming Craven
character_event = {
	id = 271
	desc = EVTDESC271
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
		NOT = { trait = brave }
		NOT = { trait = craven }
		NOT = { trait = berserker }
		immortal = no
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			trait = clubfooted
			factor = 1.25
		}
		modifier = {
			trait = hunchback
			factor = 1.25
		}
		modifier = {
			trait = lisp
			factor = 1.1
		}
		modifier = {
			trait = stutter
			factor = 1.1
		}
		modifier = {
			trait = dwarf
			factor = 1.25
		}
		modifier = {
			trait = genius
			factor = 0.9
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 0.9
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 2.0
		}
		
		modifier = {
			trait = imbecile
			factor = 3.0
		}
		modifier = {
			trait = inbred
			factor = 3.0
		}
		modifier = {
			is_strong_trigger = yes
			factor = 0.7
		}
		modifier = {
			is_weak_trigger = yes
			factor = 2.5
		}
		modifier = {
			factor = 1.25
			trait = stressed
		}
		modifier = {
			factor = 1.5
			trait = depressed
		}
		modifier = {
			factor = 3.0
			trait = lunatic
		}
		modifier = {
			factor = 2.0
			trait = possessed
		}
		modifier = {
			factor = 1.1
			is_ill = yes
		}
		modifier = {
			factor = 1.25
			trait = pneumonic
		}
		modifier = {
			factor = 1.25
			trait = syphilitic
		}
		modifier = {
			factor = 2.0
			trait = leper
		}
		modifier = {
			factor = 1.15
			trait = wounded
		}
		modifier = {
			factor = 1.25
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 2.0
			trait = infirm
		}
		modifier = {
			factor = 3.0
			trait = incapable
		}
		modifier = {
			factor = 1.1
			trait = drunkard
		}
		modifier = {
			factor = 1.1
			trait = has_tuberculosis
		}
		modifier = {
			factor = 1.1
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 1.5
			trait = has_typhus
		}
		modifier = {
			factor = 1.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 1.1
			trait = has_measles
		}
		modifier = {
			factor = 1.1
			trait = has_small_pox
		}
	}

	option = {
		name = CURSES
		add_trait = craven
		random = {
			chance = 50
			#Demote battle trait
			if = {
				limit = { trait = poor_warrior }
				remove_trait = poor_warrior
			}
			if = {
				limit = { trait = trained_warrior }
				remove_trait = trained_warrior
			}
			if = {
				limit = { trait = skilled_warrior }
				remove_trait = skilled_warrior
				add_trait = trained_warrior
			}
			if = {
				limit = { trait = master_warrior }
				remove_trait = master_warrior
				add_trait = skilled_warrior
			}
		}
		if = {
			limit = {
				is_ruler = yes
				religion_group = muslim
			}
			piety = -25
		}
	}
}

#On-action combat event: Becoming Wroth
character_event = {
	id = 272
	desc = EVTDESC272
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
		NOT = { trait = wroth }
		NOT = { trait = patient }
		immortal = no
	}
	
	weight_multiplier = {
		days = 1
	}

	option = {
		name = CURSES
		add_trait = wroth
	}
}

#On-action combat event: Becoming Patient
character_event = {
	id = 273
	desc = EVTDESC273
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war

	is_triggered_only = yes
	
	trigger = {
		is_alive = yes
		NOT = { trait = wroth }
		NOT = { trait = patient }
		immortal = no
	}
	
	weight_multiplier = {
		days = 1
	}

	option = {
		name = EXCELLENT
		add_trait = patient
	}
}

#On-action battle_won: Heroism shown.
character_event = {
	id = 260
	hide_window = yes
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
		NOT = { trait = craven }
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 2.0
			trait = brave
		}
		modifier = {
			factor = 1.5
			martial = 10
		}

		modifier = {
			trait = genius
			factor = 1.2
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.1
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.9
		}
		
		modifier = {
			trait = imbecile
			factor = 0.2
		}
		modifier = {
			trait = inbred
			factor = 0.2
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.5
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}
		modifier = {
			factor = 0.9
			trait = stressed
		}
		modifier = {
			factor = 0.8
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.75
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.8
			trait = pneumonic
		}
		modifier = {
			factor = 0.8
			trait = syphilitic
		}
		modifier = {
			factor = 0.5
			trait = leper
		}
		modifier = {
			factor = 0.9
			trait = wounded
		}
		modifier = {
			factor = 0.8
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 0.5
			trait = infirm
		}
		modifier = {
			factor = 0.4
			trait = incapable
		}
		modifier = {
			factor = 0.5
			trait = drunkard
		}
		modifier = {
			factor = 0.5
			trait = has_tuberculosis
		}
		modifier = {
			factor = 0.5
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 0.5
			trait = has_typhus
		}
		modifier = {
			factor = 0.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 0.5
			trait = has_measles
		}
		modifier = {
			factor = 0.5
			trait = has_small_pox
		}

	}
	
	immediate = {
		random_list = {
			16 = { character_event = { id = 262 } }
			16 = { character_event = { id = 263 } }
			16 = { character_event = { id = 264 } }
			16 = { character_event = { id = 265 } }
			16 = { character_event = { id = 266 } }
			16 = { character_event = { id = 267 } }
		}
		hidden_tooltip = {
			random = {
				chance = 25
				change_variable = { which = "lifestyle_martial" value = 1 }
			}
		}
		#Promote battle trait
		if = {
			limit = {
				trait = skilled_warrior
				NOT = { has_character_flag = promoted_cta }
			}
			add_trait = master_warrior
			set_character_flag = promoted_cta
		}
		if = {
			limit = { 
				trait = trained_warrior
				NOT = { has_character_flag = promoted_cta }
			}
			add_trait = skilled_warrior
			set_character_flag = promoted_cta
		}
		if = {
			limit = {
				trait = poor_warrior
				NOT = { has_character_flag = promoted_cta }
			}
			add_trait = trained_warrior
			set_character_flag = promoted_cta
		}
		if = {
			limit = {
				NOT = { trait = poor_warrior }
				NOT = { trait = trained_warrior }
				NOT = { trait = skilled_warrior }
				NOT = { trait = master_warrior }
				NOT = { has_character_flag = promoted_cta }
			}
			add_trait = poor_warrior
			set_character_flag = promoted_cta
		}
	}

	option = {
		hidden_tooltip = { clr_character_flag = promoted_cta }
	}
}


#On-action battle_won: Soldier Distinguishes himself.
character_event = {
	id = 261
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	hide_from = yes
	
	is_triggered_only = yes
	
	trigger = {
		is_alive = yes
		ai = no
	}
	
	immediate = {
		create_random_soldier = {
			random_traits = yes
			dynasty = random
			female = no
			religion = ROOT
			culture = ROOT
			attributes = {
				martial = 8
				stewardship = 3
				diplomacy = 3
				learning = 3
				intrigue = 3
			}
		}
		new_character = {
			remove_trait = craven
			save_event_target_as = soldier_target
		}
	}

	desc = {
		trigger = {
			NOR = {
				has_character_modifier = good_battle_omen
				has_character_modifier = bad_battle_omen
			}
		}
		text = EVTDESC261
	}
	
	desc = {
		trigger = {
			has_dlc = "Mystics"
			has_character_modifier = good_battle_omen
		}
		text = EVTDESC261_good_battle_omen
	}
	desc = {
		trigger = {
			has_dlc = "Mystics"
			has_character_modifier = bad_battle_omen
		}
		text = EVTDESC261_bad_battle_omen
	}

	weight_multiplier = {
		days = 1
		modifier = {
			factor = 1.5
			trait = patient
		}
		modifier = {
			factor = 1.5
			trait = just
		}
		modifier = {
			factor = 1.5
			trait = diligent
		}
		modifier = {
			factor = 0.2
			trait = deceitful
		}
		modifier = {
			factor = 0.2
			trait = arbitrary
		}
		modifier = {
			factor = 2
			has_character_modifier = good_battle_omen
		}
		modifier = {
			factor = 0.9
			has_character_modifier = bad_battle_omen
		}
	}

	option = {
		name = EXCELLENT
		event_target:soldier_target = {
			prestige = 50
		}
		trigger = {
			NOR = {
				has_character_modifier = good_battle_omen
				has_character_modifier = bad_battle_omen
			}
		}
	}
	option = {
		name = 261_OPTA

		event_target:soldier_target = {
			prestige = 50
		}
		upgrade_seer_modifier_effect = yes
		trigger = {
			has_dlc = "Mystics"
			has_character_modifier = good_battle_omen
		}
	}
	option = {
		name = 261_OPTB
		event_target:soldier_target = {
			prestige = 50
		}
		downgrade_seer_modifier_effect = yes
		trigger = {
			has_dlc = "Mystics"
			has_character_modifier = bad_battle_omen
		}
	}
	after = {
		remove_scrying_omen_modifiers_effect = yes
	}
}

# Heroism Shown 1
character_event = {
	id = 262
	desc = EVTDESC262
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA262
		prestige = 100
	}
}

# Heroism Shown 2
character_event = {
	id = 263
	desc = EVTDESC263
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA262
		prestige = 100
	}
}

# Heroism Shown 3
character_event = {
	id = 264
	desc = EVTDESC264
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA262
		prestige = 100
	}
}

# Heroism Shown 4
character_event = {
	id = 265
	desc = EVTDESC265
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA262
		prestige = 100
	}
}

# Heroism Shown 5
character_event = {
	id = 266
	desc = EVTDESC266
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA262
		prestige = 100
	}
}

# Heroism Shown 6
character_event = {
	id = 267
	desc = EVTDESC267
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA262
		prestige = 100
	}
}


#On-action battle_lost: Imprisoned by the enemy
character_event = {
	id = 250
	desc = EVTDESC250
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		is_alive = yes
		prisoner = no
		NOT = {
			character = FROM
		}
	}
	
	weight_multiplier = {
		days = 1

		modifier = {
			factor = 2.0
			is_ruler = yes
		}
		modifier = {
			factor = 2.0
			OR = {
				higher_tier_than = baron
				is_patrician = yes
			}
		}
		modifier = {
			factor = 1.25
			trait = brave
		}
		modifier = {
			factor = 0.25
			trait = craven
		}
		modifier = {
			factor = 0.25
			trait = paranoid
		}

		modifier = {
			factor = 1.25
			trait = stressed
		}
		modifier = {
			factor = 1.5
			trait = depressed
		}
		modifier = {
			factor = 3.0
			trait = lunatic
		}
		modifier = {
			factor = 2.0
			trait = possessed
		}
		modifier = {
			factor = 1.1
			is_ill = yes
		}
		modifier = {
			factor = 1.25
			trait = pneumonic
		}
		modifier = {
			factor = 1.25
			trait = syphilitic
		}
		modifier = {
			factor = 2.0
			trait = leper
		}
		modifier = {
			factor = 1.15
			trait = wounded
		}
		modifier = {
			factor = 1.25
			is_maimed_trigger = yes
		}
		modifier = {
			factor = 2.0
			trait = infirm
		}
		modifier = {
			factor = 3.0
			trait = incapable
		}
		modifier = {
			factor = 1.1
			trait = drunkard
		}
		modifier = {
			factor = 1.1
			trait = has_tuberculosis
		}
		modifier = {
			factor = 1.1
			trait = has_typhoid_fever
		}
		modifier = {
			factor = 1.5
			trait = has_typhus
		}
		modifier = {
			factor = 1.5
			trait = has_bubonic_plague
		}
		modifier = {
			factor = 1.1
			trait = has_measles
		}
		modifier = {
			factor = 1.1
			trait = has_small_pox
		}

	}
	
	immediate = {
		imprison = FROM
	}

	option = {
		name = CURSES
		hidden_tooltip = {
			FROM = {
				character_event = {
					id = 50020 # imprisoned_events.txt
				}
			}
		}
	}
}

# Leading attacker dies, will never trigger from code
letter_event = {
	id = 251
	is_triggered_only = yes
	border = GFX_event_letter_frame_war
	
	trigger = {
		ai = no
	}

	desc = EVTDESC251

	option = {
		name = OK
	}
}

# Leading defender dies, will never trigger from code
letter_event = {
	id = 252
	desc = EVTDESC251
	border = GFX_event_letter_frame_war
	
	is_triggered_only = yes

	trigger = {
		ai = no
	}
	
	option = {
		name = OK
	}
}

#Marshal: Unnecessary violence
character_event = {
	id = 255
	desc = EVTDESC255
	picture = GFX_evt_torture
	border = GFX_event_normal_frame_war
	
	capable_only = yes
	war = yes
	
	is_triggered_only = yes
	
	trigger = {
		in_command_trigger = yes
		has_job_title = job_marshal
		trait = cruel
	}
	
	weight_multiplier = {
		days = 1
	}
	
	option = {
		name = EVTOPTA255
		prestige = -20
		piety = -20
		hidden_tooltip = {
			liege = {
				character_event = {
					id = 256
				}
			}
		}
	}
}

#Liege: Marshal used unnecessary violence
character_event = {
	id = 256
	desc = EVTDESC256
	picture = GFX_evt_torture
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA256 #That's the cruelty of war
		piety = -10
	}
	option = {
		name = EVTOPTB256 #Disapprove of his conduct
		opinion = {
			modifier = opinion_disapprove
			who = FROM
			years = 10
		}
	}
	option = {
		name = EVTOPTC256 #He's right, we should terrorise our enemy
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
		piety = -25
		random = {
			chance = 33

			add_trait = cruel
			hidden_tooltip = {
				character_event ={
					id = 38259 #Notify Cruel
				}
			}
		}
	}
}

### Combat Trait Events

# Event 1
character_event = {
	id = 96500
	desc = EVTDESC96500
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		can_have_more_leadership_traits = yes
		is_alive = yes
		OR = {
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
			NOR = {
				trait = defensive_leader
				trait = aggressive_leader
			}
			NOT = {
				trait = inspiring_leader
			}
		}
		NOT = { trait = incapable }
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 1.5
			martial = 10
		}
		modifier = {
			factor = 1.5
			martial = 14
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = genius
			factor = 1.5
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.2
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.5
		}
		modifier = {
			trait = imbecile
			factor = 0.1
		}
		modifier = {
			trait = inbred
			factor = 0.7
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.2
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}
		modifier = {
			factor = 0.85
			trait = stressed
		}
		modifier = {
			factor = 0.85
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.5
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.6
			trait = infirm
		}
		modifier = {
			factor = 0.9
			trait = drunkard
		}
	}

	option = {
		name = EVTOPTK96500 # Jungle Terrain Specialization
		trigger = {
			location = { terrain = jungle }
			NOT = { trait = jungle_terrain_leader }
		}
		add_trait = jungle_terrain_leader
	}
	option = {
		name = EVTOPTL96500 # War elephants
		trigger = {
			has_dharmic_religion_trigger = yes
			NOT = { trait = war_elephant_leader }
		}
		add_trait = war_elephant_leader
	}
	option = {
		name = EVTOPTM96500 # WINTER Terrain Specialization
		trigger = {
			location = { is_winter = yes }
			NOT = { trait = winter_soldier }
		}
		add_trait = winter_soldier
	}
	option = {
		name = EVTOPTA96500 # Rough Terrain Specialization
		trigger = {
			OR = {
				location = { terrain = forest }
				location = { terrain = hills }
			}
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = rough_terrain_leader
	}
	option = {
		name = EVTOPTB96500 # Flat Terrain Specialization
		trigger = {
			OR = {
				location = { terrain = savanna }
				location = { terrain = plains }
				location = { terrain = farmlands }
				location = { terrain = steppe }
			}
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = flat_terrain_leader
	}
	option = {
		name = EVTOPTC96500 # Mountain Terrain Specialization
		trigger = {
			location = { terrain = mountain }
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = mountain_terrain_leader
	}
	option = {
		name = EVTOPTD96500 # Desert Terrain Leader
		trigger = {
			location = { terrain = desert }
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = desert_terrain_leader
	}
	option = {
		name = EVTOPTE96500 # Cavalry
		trigger = {
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
		}
		add_trait = cavalry_leader
	}
	option = {
		name = EVTOPTF96500 # Light Infantry
		trigger = {
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
		}
		add_trait = light_foot_leader
	}
	option = {
		name = EVTOPTG96500 # Heavy Infantry
		trigger = {
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
		}
		add_trait = heavy_infantry_leader
	}
	option = {
		name = EVTOPTH96500 # Aggressive
		trigger = {
			NOR = {
				trait = defensive_leader
				trait = aggressive_leader
			}
		}
		add_trait = aggressive_leader
	}
	option = {
		name = EVTOPTI96500 # Defensive
		trigger = {
			NOR = {
				trait = defensive_leader
				trait = aggressive_leader
			}
		}
		add_trait = defensive_leader
	}
	option = {
		name = EVTOPTJ96500 # Inspiring
		trigger = {
			NOT = {
				trait = inspiring_leader
			}
		}
		add_trait = inspiring_leader
	}
}

# Event 2
character_event = {
	id = 96501
	desc = EVTDESC96500
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes

	trigger = {
		can_have_more_leadership_traits = yes
		is_alive = yes
		OR = {
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
			NOT = {
				trait = flanker
			}
			NOT = {
				trait = trickster
			}
		}
		NOT = { trait = incapable }
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = genius
			factor = 1.5
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.2
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.5
		}
		modifier = {
			trait = imbecile
			factor = 0.1
		}
		modifier = {
			trait = inbred
			factor = 0.7
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.2
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}
		modifier = {
			factor = 0.85
			trait = stressed
		}
		modifier = {
			factor = 0.85
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.5
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.6
			trait = infirm
		}
		modifier = {
			factor = 0.9
			trait = drunkard
		}
	}

	option = {
		name = EVTOPTA96500 # Rough Terrain Specialization
		trigger = {
			OR = {
				location = { terrain = forest }
				location = { terrain = hills }
			}
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = rough_terrain_leader
	}
	option = {
		name = EVTOPTB96500 # Flat Terrain Specialization
		trigger = {
			OR = {
				location = { terrain = savanna }
				location = { terrain = plains }
				location = { terrain = farmlands }
			}
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = flat_terrain_leader
	}
	option = {
		name = EVTOPTC96500 # Mountain Terrain Specialization
		trigger = {
			location = { terrain = mountain }
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = mountain_terrain_leader
	}
	option = {
		name = EVTOPTD96500 # Desert Terrain Leader
		trigger = {
			location = { terrain = desert }
			NOR = {
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = desert_terrain_leader
	}
	option = {
		name = EVTOPTE96500 # Cavalry
		trigger = {
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
		}
		add_trait = cavalry_leader
	}
	option = {
		name = EVTOPTF96500 # Light Infantry
		trigger = {
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
		}
		add_trait = light_foot_leader
	}
	option = {
		name = EVTOPTG96500 # Heavy Infantry
		trigger = {
			NOR = {
				trait = cavalry_leader
				trait = heavy_infantry_leader
				trait = light_foot_leader
			}
		}
		add_trait = heavy_infantry_leader
	}
	option = { # Trickster
		name = EVTOPTH96501
		trigger = {
			NOT = {
				trait = trickster
			}
		}
		add_trait = trickster
	}
	option = { # Flanker
		name = EVTOPTI96501
		trigger = {
			NOT = {
				trait = flanker
			}
		}
		add_trait = flanker
	}
}

# Event 3
character_event = {
	id = 96502
	desc = EVTDESC96500
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = {
		can_have_more_leadership_traits = yes
		is_alive = yes
		OR = {
			NOT = {
				trait = organizer
			}
			NOT = {
				trait = experimenter
			}
			NOR = {
				trait = holy_warrior
				trait = cynical
			}
			NOT = {
				trait = unyielding_leader
			}
		}
		NOT = { trait = incapable }
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = genius
			factor = 1.5
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.2
		}
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.5
		}
		modifier = {
			trait = imbecile
			factor = 0.1
		}
		modifier = {
			trait = inbred
			factor = 0.7
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.2
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}
		modifier = {
			factor = 0.85
			trait = stressed
		}
		modifier = {
			factor = 0.85
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.5
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.6
			trait = infirm
		}
		modifier = {
			factor = 0.9
			trait = drunkard
		}
	}

	option = { # Organizer
		name = EVTOPTA96502
		trigger = {
			NOT = {
				trait = organizer
			}
		}
		add_trait = organizer
	}
	option = { # Experimenter
		name = EVTOPTB96502
		trigger = {
			NOT = {
				trait = experimenter
			}
		}
		add_trait = experimenter
	}
	option = { # Holy Warrior
		name = EVTOPTC96502
		trigger = {
			trait = zealous
			NOR = {
				trait = holy_warrior
				trait = cynical
			}
		}
		add_trait = holy_warrior
	}
	option = { # Unyielding
		name = EVTOPTD96502
		trigger = {
			NOT = {
				trait = unyielding_leader
			}
		}
		add_trait = unyielding_leader
	}
}

# Event 4
character_event = {
	id = 96503
	desc = EVTDESC96500
	picture = GFX_evt_battle
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	trigger = { 
		can_have_more_leadership_traits = yes
		is_alive = yes
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			trait = genius
			factor = 1.5
		}
		modifier = {
			OR = {
				trait = quick
				trait = shrewd
			}
			factor = 1.2
		}	
		modifier = {
			OR = {
				trait = slow
				trait = dull
			}
			factor = 0.5
		}
		modifier = {
			trait = imbecile
			factor = 0.1
		}
		modifier = {
			trait = inbred
			factor = 0.7
		}
		modifier = {
			is_strong_trigger = yes
			factor = 1.2
		}
		modifier = {
			is_weak_trigger = yes
			factor = 0.8
		}		
		modifier = {
			factor = 0.85
			trait = stressed
		}
		modifier = {
			factor = 0.85
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = lunatic
		}
		modifier = {
			factor = 0.5
			trait = possessed
		}
		modifier = {
			factor = 0.9
			is_ill = yes
		}
		modifier = {
			factor = 0.6
			trait = infirm
		}
		modifier = {
			factor = 0.9
			trait = drunkard
		}
	}

	option = {
		name = EVTOPTA96500 # Rough Terrain Specialization
		trigger = {
			OR = {
				location = { terrain = forest }
				location = { terrain = hills }
			}
			NOR = { 
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = rough_terrain_leader
	}
	option = {
		name = EVTOPTB96500 # Flat Terrain Specialization
		trigger = {
			OR = {
				location = { terrain = savanna }
				location = { terrain = plains }
				location = { terrain = farmlands }
				location = { terrain = steppe }
			}
			NOR = { 
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = flat_terrain_leader
	}
	option = {
		name = EVTOPTC96500 # Mountain Terrain Specialization
		trigger = {
			location = { terrain = mountain }
			NOR = { 
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = mountain_terrain_leader
	}
	option = {
		name = EVTOPTD96500 # Desert Terrain Leader
		trigger = {
			location = { terrain = desert }
			NOR = { 
				trait = rough_terrain_leader
				trait = flat_terrain_leader
				trait = mountain_terrain_leader
				trait = desert_terrain_leader
			}
		}
		add_trait = desert_terrain_leader
	}
	option = { # Flanker
		name = EVTOPTI96501
		trigger = {
			NOT = { 
				trait = flanker
			}
		}
		add_trait = flanker
	}
	option = { # Narrow flank leader
		name = EVTOPTJ96501
		trigger = {
			OR = {
				location = { terrain = mountain }
				location = { terrain = hills }
				location = { terrain = forest }
			}
			NOT = { 
				trait = narrow_flank_leader
			}
		}
		add_trait = narrow_flank_leader
	}
	option = { # Siege leader
		name = EVTOPTK96501
		trigger = {
			siege = {
				is_attacker = yes
			}
			NOT = { 
				trait = siege_leader
			}
		}
		add_trait = siege_leader
	}
}

