###########################################
#                                         #
# Horse Lords Mercenaries Events  		  #
#                                         #
# ID HL.10000-HL.10999     	              #
#                                         #
###########################################

# 10100 - 10199 Military Education
# 10200 - 10299 Trait development
# 10300 - 10399 Prestigious events
# 10400 - 10499 Religious Events
# 10500 - 10599 Relationship events
# 10600 - 10699 Education events
# 10700 - 10799 External notification events

# Written by Henrik "Groogy" Hansson

namespace = HL

### Improve on military education
character_event = {
	id = HL.10100

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes

		OR = {
			trait = misguided_warrior
			trait = tough_soldier
			trait = skilled_tactician
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		trigger_switch = {
			on_trigger = trait

			misguided_warrior = {
				remove_trait = misguided_warrior
				add_trait = tough_soldier
			}

			tough_soldier = {
				remove_trait = tough_soldier
				add_trait = skilled_tactician
			}

			skilled_tactician = {
				remove_trait = skilled_tactician
				add_trait = brilliant_strategist
			}
		}

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10101 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of education change
character_event = {
	id = HL.10101
	desc = EVTDESC_HL_10101
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10101

		tooltip = {
			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = trait

					tough_soldier = { add_trait = tough_soldier }
					skilled_tactician = { add_trait = skilled_tactician }
					brilliant_strategist = { add_trait = brilliant_strategist }
				}
			}
		}
	}
}

### Mercenary captain stop being a silly coward
character_event = {
	id = HL.10200

	is_triggered_only = yes # on_yearly_pulse, random_events; on_combat_pulse via HFP.11000, HF_battle_events.txt
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes
		trait = craven
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		remove_trait = craven

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10201 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of craven removal
character_event = {
	id = HL.10201
	desc = EVTDESC_HL_10201
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10201

		tooltip = {
			FROM = {
				show_scope_change = no

				remove_trait = craven
			}
		}
	}
}

### Mercenary captain becomes brave
character_event = {
	id = HL.10210

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes

		NOR = {
			trait = craven
			trait = brave
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		add_trait = brave

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10211 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of brave added
character_event = {
	id = HL.10211
	desc = EVTDESC_HL_10211
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10211

		tooltip = {
			FROM = {
				show_scope_change = no

				add_trait = brave
			}
		}
	}
}

### Mercenary captain becomes diligent
character_event = {
	id = HL.10220

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes

		NOR = {
			trait = diligent
			trait = slothful
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		add_trait = diligent

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10221 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of brave added
character_event = {
	id = HL.10221
	desc = EVTDESC_HL_10221
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10221

		tooltip = {
			FROM = {
				show_scope_change = no

				add_trait = diligent
			}
		}
	}
}

### Mercenary captain stopped being kind
character_event = {
	id = HL.10230

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes
		trait = kind
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		remove_trait = kind

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10231 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of kind removed
character_event = {
	id = HL.10231
	desc = EVTDESC_HL_10231
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10231

		tooltip = {
			FROM = {
				show_scope_change = no

				remove_trait = kind
			}
		}
	}
}

### Mercenary captain stops being humble
character_event = {
	id = HL.10240

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes
		trait = humble
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		remove_trait = humble

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10241 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of humble removed
character_event = {
	id = HL.10241
	desc = EVTDESC_HL_10241
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10241

		tooltip = {
			FROM = {
				show_scope_change = no

				remove_trait = humble
			}
		}
	}
}

### Mercenary captain becomes lustful
character_event = {
	id = HL.10250

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes

		NOR = {
			trait = lustful
			trait = chaste
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		add_trait = lustful

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10251 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of lustful added
character_event = {
	id = HL.10251
	desc = EVTDESC_HL_10251
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10251

		tooltip = {
			FROM = {
				show_scope_change = no

				add_trait = lustful
			}
		}
	}
}

### Mercenary captain becomes very angry
character_event = {
	id = HL.10260

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes

		NOR = {
			trait = wroth
			trait = patient
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		add_trait = wroth

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10261 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of wroth added
character_event = {
	id = HL.10261
	desc = EVTDESC_HL_10261
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10261

		tooltip = {
			FROM = {
				show_scope_change = no

				add_trait = wroth
			}
		}
	}
}

### Mercenary captain becomes cruel
character_event = {
	id = HL.10270

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		mercenary = yes

		NOR = {
			trait = cruel
			trait = kind
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		add_trait = cruel

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10271 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of cruel added
character_event = {
	id = HL.10271
	desc = EVTDESC_HL_10271
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10271

		FROM = {
			show_scope_change = no

			add_trait = cruel
		}
	}
}

### Fighting a great commander
character_event = {
	id = HL.10300

	is_triggered_only = yes # on_combat_pulse via HFP.11000, HF_battle_events.txt
	hide_window = yes

	immediate = {
		set_character_flag = fought_great_commander
		prestige = 100

		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10301 } # Notify daddy about progress
				}
			}
		}
	}
}

### Notify band creator of awesome fight with prestigious commander
character_event = {
	id = HL.10301
	desc = EVTDESC_HL_10301
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10301

		tooltip = {
			FROM = {
				show_scope_change = no

				prestige = 100
			}
		}
	}
}

### Mercenary captain starts to gain sympathy for local religion
character_event = {
	id = HL.10400

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }

			capital_scope = {
				owner = {
					NOT = { religion_group = ROOT }
				}
			}
		}

		mercenary = yes
		NOT = { trait = zealous }
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 1.5
			mercenary_employer = { is_alive = yes }
		}

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_friend = ROOT }
		}

		mult_modifier = {
			factor = 2

			primary_title = {
				capital_scope = {
					owner = {
						is_friend = ROOT
						NOT = { religion_group = ROOT }
					}
				}
			}
		}
	}

	immediate = {
		primary_title = {
			capital_scope = {
				save_event_target_as = merc_location

				owner = {
					trigger_switch = {
						on_trigger = religion_group

						christian         = { ROOT = { add_trait = sympathy_christendom } }
						muslim            = { ROOT = { add_trait = sympathy_islam } }
						pagan_group       = { ROOT = { add_trait = sympathy_pagans } }
						zoroastrian_group = { ROOT = { add_trait = sympathy_zoroastrianism } }
						jewish_group      = { ROOT = { add_trait = sympathy_judaism } }
						indian_group      = { ROOT = { add_trait = sympathy_indian } }
					}
				}
			}

			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10401 }
				}
			}
		}
	}
}

character_event = {
	id = HL.10401
	desc = EVTDESC_HL_10401
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10401

		tooltip = {
			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = trait

					sympathy_christendom	= { add_trait = sympathy_christendom }
					sympathy_islam			= { add_trait = sympathy_islam }
					sympathy_pagans			= { add_trait = sympathy_pagans }
					sympathy_zoroastrianism	= { add_trait = sympathy_zoroastrianism }
					sympathy_judaism		= { add_trait = sympathy_judaism }
					sympathy_indian			= { add_trait = sympathy_indian }
				}
			}
		}
	}
}

### Mercenary captain converts to local religion
character_event = {
	id = HL.10410

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }

			capital_scope = {
				owner = {
					NOT = { religion = ROOT }
				}
			}
		}

		mercenary = yes
		NOT = { trait = zealous }
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 1.5
			mercenary_employer = { is_alive = yes }
		}

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_friend = ROOT }
		}

		mult_modifier = {
			factor = 2

			primary_title = {
				capital_scope = {
					owner = {
						is_friend = ROOT
						NOT = { religion = ROOT }
					}
				}
			}
		}

		mult_modifier = {
			factor = 4

			primary_title = {
				capital_scope = {
					owner = {
						trigger_if = {
							limit = { religion_group = christian }
							ROOT = { trait = sympathy_christendom }
						}
						trigger_else_if = {
							limit = { religion_group = muslim }
							ROOT = { trait = sympathy_islam }
						}
						trigger_else_if = {
							limit = { religion_group = pagan_group }
							ROOT = { trait = sympathy_pagans }
						}
						trigger_else_if = {
							limit = { religion_group = zoroastrian_group }
							ROOT = { trait = sympathy_zoroastrianism }
						}
						trigger_else_if = {
							limit = { religion_group = jewish_group }
							ROOT = { trait = sympathy_judaism }
						}
						trigger_else = {
							religion_group = indian_group
							ROOT = { trait = sympathy_indian }
						}
					}
				}
			}
		}
	}

	immediate = {
		primary_title = {
			capital_scope = {
				save_event_target_as = merc_location

				owner = {
					ROOT = {
						unsafe_religion = PREV

						random = {
							chance = 10
							add_trait_silently_zealous_effect = yes
						}
					}
				}
			}

			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10411 }
				}
			}
		}
	}
}

character_event = {
	id = HL.10411
	desc = EVTDESC_HL_10411
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10411

		event_target:merc_location = {
			show_scope_change = no

			owner = {
				show_scope_change = no

				FROM = {
					show_scope_change = no

					tooltip = {
						unsafe_religion = PREV

						random = {
							chance = 10
							add_trait = zealous
						}
					}

					ROOT = {
						show_scope_change = no

						if = {
							limit = {
								NOR = {
									trait = zealous
									religion_group = PREVPREV
								}
							}

							if = { limit = { trait = sympathy_christendom }    remove_trait = sympathy_christendom }
							if = { limit = { trait = sympathy_islam }          remove_trait = sympathy_islam }
							if = { limit = { trait = sympathy_pagans }         remove_trait = sympathy_pagans }
							if = { limit = { trait = sympathy_zoroastrianism } remove_trait = sympathy_zoroastrianism }
							if = { limit = { trait = sympathy_judaism }        remove_trait = sympathy_judaism }
							if = { limit = { trait = sympathy_indian }         remove_trait = sympathy_indian }

							random = {
								chance = 75

								PREV = {
									show_scope_change = no

									trigger_switch = {
										on_trigger = religion_group

										christian         = { ROOT = { show_scope_change = no add_trait = sympathy_christendom } }
										muslim            = { ROOT = { show_scope_change = no add_trait = sympathy_islam } }
										pagan_group       = { ROOT = { show_scope_change = no add_trait = sympathy_pagans } }
										zoroastrian_group = { ROOT = { show_scope_change = no add_trait = sympathy_zoroastrianism } }
										jewish_group      = { ROOT = { show_scope_change = no add_trait = sympathy_judaism } }
										indian_group      = { ROOT = { show_scope_change = no add_trait = sympathy_indian } }
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

### Seduction event between captain and child of employer
character_event = {
	id = HL.10500

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		mercenary = yes

		NOR = {
			trait = chaste
			trait = celibate
		}

		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }

			capital_scope = {
				owner = {
					any_courtier = {
						is_adult = yes

						OR = {
							is_child_of = PREV
							martial >= 20
							diplomacy >= 20
							intrigue >= 20
							stewardship >= 20
							learning >= 20
						}

						trigger_if = {
							limit = { is_opposite_sex = ROOT }

							NOR = {
								trait = homosexual
								ROOT = { trait = homosexual }
							}
						}
						trigger_else = {
							trait = homosexual
							ROOT = { trait = homosexual }
						}

						is_married = no
						prisoner = no
						is_landed = no
						has_lover = no
						is_consort = no
						NOT = { trait = celibate }
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = lustful
		}

		mult_modifier = {
			factor = 2
			trait = hedonist
		}

		mult_modifier = {
			factor = 2
			trait = master_seducer
		}

		mult_modifier = {
			factor = 1.5
			mercenary_employer = { is_alive = yes }
		}

		mult_modifier = {
			factor = 0.25

			primary_title = {
				capital_scope = {
					owner = {
						any_liege = {
							is_friend = ROOT
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.25
			mercenary_employer = { is_friend = ROOT }
		}
	}

	immediate = {
		primary_title = {
			capital_scope = {
				owner = {
					random_courtier = {
						limit = {
							is_adult = yes

							OR = {
								is_child_of = PREV
								martial >= 20
								diplomacy >= 20
								intrigue >= 20
								stewardship >= 20
								learning >= 20
							}

							trigger_if = {
								limit = { is_opposite_sex = ROOT }

								NOR = {
									trait = homosexual
									ROOT = { trait = homosexual }
								}
							}
							trigger_else = {
								trait = homosexual
								ROOT = { trait = homosexual }
							}

							prisoner = no
							is_landed = no
							is_married = no
							has_lover = no
							is_consort = no
							NOT = { trait = celibate }
						}

						save_event_target_as = eloper
						add_lover = ROOT
						move_character = ROOT
					}

					character_event = { id = HL.10501 }

					if = {
						limit = { is_parent_of = event_target:eloper }
						add_rival = ROOT
					}
				}
			}

			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10502 }
				}
			}
		}
	}
}

# Notify daddy about eloping
character_event = {
	id = HL.10501
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	desc = {
		text = EVTDESC_HL_10501
		trigger = { is_parent_of = event_target:eloper }
	}
	desc = {
		text = EVTDESC_HL_10501B
		trigger = {
			NOT = { is_parent_of = event_target:eloper }
		}
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = {
			text = EVTOPTA_HL_10501
			trigger = {
				opinion = {
					who = event_target:eloper
					value >= 0
				}
			}
		}
		name = {
			text = GOOD_RIDDANCE
			trigger = {
				opinion = {
					who = event_target:eloper
					value < 0
				}
			}
		}
	}
}

# Notify host about eloping
character_event = {
	id = HL.10502
	desc = EVTDESC_HL_10502
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = {
			text = EVTOPTA_HL_10501
			trigger = {
				opinion = {
					who = event_target:eloper
					value >= 0
				}
			}
		}
		name = {
			text = GOOD_RIDDANCE
			trigger = {
				opinion = {
					who = event_target:eloper
					value < 0
				}
			}
		}
	}
}

### Duel between son of employer and mercenary captain
character_event = {
	id = HL.10510

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		mercenary = yes

		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }
		}

		NOR = {
			trait = kind
			trait = humble
		}

		primary_title = {
			capital_scope = {
				owner = {
					any_courtier = {
						is_child_of = PREV
						is_adult = yes
						is_landed = no
						is_female = no
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = wroth
		}

		mult_modifier = {
			factor = 2
			trait = cruel
		}

		mult_modifier = {
			factor = 1.5
			mercenary_employer = { is_alive = yes }
		}

		mult_modifier = {
			factor = 0.25

			primary_title = {
				capital_scope = {
					owner = {
						any_liege = {
							is_friend = ROOT
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.25
			mercenary_employer = { is_friend = ROOT }
		}
	}

	immediate = {
		primary_title = {
			capital_scope = {
				owner = {
					random_courtier = {
						limit = {
							is_child_of = PREV
							is_adult = yes
							is_landed = no
							is_female = no
						}

						save_event_target_as = challenger
					}
				}
			}
		}

		random_list = {
			40 = { # Nothing Happens
				mult_modifier = {
					factor = 2
					combat_rating < event_target:challenger
				}

				event_target:challenger = {
					add_rival = ROOT

					father = {
						character_event = { id = HL.10515 }
					}
				}

				primary_title = {
					band_creator = {
						character_event = { id = HL.10516 }
					}
				}
			}

			75 = { # Wounded
				trigger = {
					NOR = {
						trait = maimed
						trait = wounded
						trait = severely_injured
					}
				}

				mult_modifier = {
					factor = 2

					combat_rating_diff = {
						who = event_target:challenger
						value >= 30
					}
				}

				event_target:challenger = {
					add_trait = wounded
					add_rival = ROOT

					father = {
						random = {
							chance = 50
							add_rival = ROOT
						}

						character_event = { id = HL.10517 }
					}
				}

				primary_title = {
					band_creator = {
						character_event = { id = HL.10518 }
					}
				}
			}

			25 = { # Maimed
				mult_modifier = {
					factor = 2

					combat_rating_diff = {
						who = event_target:challenger
						value >= 30
					}
				}

				mult_modifier = {
					factor = 2

					combat_rating_diff = {
						who = event_target:challenger
						value >= 40
					}
				}

				event_target:challenger = {
					add_maimed_trait_effect = yes
					add_rival = ROOT

					father = {
						random = {
							chance = 90
							add_rival = ROOT
						}

						character_event = { id = HL.10519 }
					}
				}

				primary_title = {
					band_creator = {
						character_event = { id = HL.10520 }
					}
				}
			}

			10 = { # Dies
				mult_modifier = {
					factor = 2

					combat_rating_diff = {
						who = event_target:challenger
						value >= 30
					}
				}

				mult_modifier = {
					factor = 2

					combat_rating_diff = {
						who = event_target:challenger
						value >= 40
					}
				}

				mult_modifier = {
					factor = 2

					combat_rating_diff = {
						who = event_target:challenger
						value >= 50
					}
				}

				event_target:challenger = {
					death = {
						death_reason = death_duel
						killer = ROOT
					}

					father = {
						add_rival = ROOT
						character_event = { id = HL.10521 }
					}
				}

				primary_title = {
					band_creator = {
						character_event = { id = HL.10522 }
					}
				}
			}
		}
	}
}

# Notify daddy about nothing happening duel
character_event = {
	id = HL.10515
	desc = EVTDESC_HL_10515
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10515

		show_portrait = event_target:challenger
	}
}

# Notify band creator about nothing happening duel
character_event = {
	id = HL.10516
	desc = EVTDESC_HL_10516
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10516

		show_portrait = event_target:challenger
	}
}


# Notify daddy about wound duel
character_event = {
	id = HL.10517
	desc = EVTDESC_HL_10517
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10517

		show_portrait = event_target:challenger
	}
}

# Notify band creator about wound duel
character_event = {
	id = HL.10518
	desc = EVTDESC_HL_10518
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10518

		show_portrait = event_target:challenger
	}
}

# Notify daddy about maimed duel
character_event = {
	id = HL.10519
	desc = EVTDESC_HL_10519
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10517

		show_portrait = event_target:challenger
	}
}

# Notify band creator about maimed duel
character_event = {
	id = HL.10520
	desc = EVTDESC_HL_10520
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10520

		show_portrait = event_target:challenger
	}
}

# Notify daddy about death duel
character_event = {
	id = HL.10521
	desc = EVTDESC_HL_10521
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10521

		show_portrait = event_target:challenger
	}
}

# Notify band creator about death duel
character_event = {
	id = HL.10522
	desc = EVTDESC_HL_10522
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10520

		show_portrait = event_target:challenger
	}
}

### Possibility to invite mercenary captain to a feast
character_event = {
	id = HL.10530
	desc = EVTDESC_HL_10530
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_rulers = yes
	only_capable = yes
	prisoner = no

	trigger = {
		any_mercenary_band = {
			holder_scope = {
				has_character_flag = is_mercenary_leader

				NOR = {
					is_friend = ROOT
					is_rival = ROOT
					is_close_relative = ROOT
				}
			}

			NOT = { has_title_flag = ze_dyn_merc }

			capital_scope = {
				ROOT = {
					capital_scope = {
						province = PREVPREV
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1
	}

	option = {
		name = EVTOPTA_HL_10530

		any_mercenary_band = { # No random_ variant exists
			count = 1

			limit = {
				holder_scope = {
					has_character_flag = is_mercenary_leader

					NOR = {
						is_friend = ROOT
						is_rival = ROOT
						is_close_relative = ROOT
					}
				}

				NOT = { has_title_flag = ze_dyn_merc }

				capital_scope = {
					ROOT = {
						capital_scope = {
							province = PREVPREV
						}
					}
				}
			}

			holder_scope = {
				show_portrait = yes

				character_event = {
					id = HL.10531
					days = 3
				}
			}
		}
	}

	option = {
		name = EVTOPTB_HL_10530
	}
}

### Mercenary captain responds
character_event = {
	id = HL.10531

	is_triggered_only = yes
	hide_window = yes

	option = {
		FROM = {
			character_event = {
				id = HL.10532
				days = 3
			}
		}

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 1.3
				trait = kind
			}

			mult_modifier = {
				factor = 1.5
				trait = gregarious
			}

			mult_modifier = {
				factor = 2
				trait = trusting
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value >= 25
				}
			}

			mult_modifier = {
				factor = 3

				opinion = {
					who = FROM
					value >= 50
				}
			}
		}
	}

	option = {
		FROM = {
			character_event = {
				id = HL.10533
				days = 3
			}
		}

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 1.5
				trait = shy
			}

			mult_modifier = {
				factor = 1.5
				trait = paranoid
			}

			mult_modifier = {
				factor = 2

				trait = zealous
				NOT = { religion_group = FROM }
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 3

				opinion = {
					who = FROM
					value < -50
				}
			}
		}
	}
}

### Response to feast from mercenary captain is positive
character_event = {
	id = HL.10532
	desc = EVTDESC_HL_10532
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10532

		add_friend = FROM
	}
}

### Response to feast from mercenary captain is negative
character_event = {
	id = HL.10533
	desc = EVTDESC_HL_10533
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10533
	}
}

### The captain gain mercenary traditions from being on the field
character_event = {
	id = HL.10600

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	has_character_flag = is_mercenary_leader
	only_playable = yes
	only_capable = yes
	prisoner = no
	ai = yes

	trigger = {
		mercenary = yes

		primary_title = {
			NOT = { has_title_flag = ze_dyn_merc }

			# band_creator = {
			#	is_alive = yes
			# }
		}

		NOT = { trait = craven }
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			mercenary_employer = { is_alive = yes }
		}
	}

	immediate = {
		primary_title = {
			band_creator = {
				if = {
					limit = { is_alive = yes }
					character_event = { id = HL.10601 }
				}
			}
		}

		if = { # Just to make sure
			limit = {
				NOT = { has_character_modifier = mercenary_traditions }
			}

			add_character_modifier = {
				name = mercenary_traditions
				duration = -1
			}
		}
	}
}

### Notifying Daddy about becomming skilled with handling mercenaries
character_event = {
	id = HL.10601
	desc = EVTDESC_HL_10601
	picture = GFX_evt_steppe_mercenaries
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10601

		add_character_modifier = {
			name = mercenary_traditions
			duration = -1
		}
	}
}

### Curious about tales from dad's past for ward
character_event = {
	id = HL.10610
	desc = EVTDESC_HL_10610
	picture = GFX_evt_guardian

	is_triggered_only = yes # on_yearly_pulse, random_events
	# TODO: on_yearly_childhood_pulse instead?

	min_age = 6
	max_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_guardian = yes
		NOT = { has_character_modifier = mercenary_traditions }

		father = {
			has_character_modifier = mercenary_traditions

			primary_title = {
				mercenary = no
			}
		}

		educator = {
			is_incapable = no
			prisoner = no
		}
	}

	option = {
		name = EVTOPTA_HL_10610

		educator = {
			if = {
				limit = { is_father = ROOT }
				character_event = { id = HL.10612 }
			}
			else = {
				character_event = { id = HL.10611 }
			}
		}
	}
}

### Non-father guardian event
character_event = {
	id = HL.10611
	desc = EVTDESC_HL_10611
	picture = GFX_evt_guardian

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10611

		FROM = {
			character_event = { id = HL.10613 }
		}
	}

	option = {
		name = EVTOPTB_HL_10611

		FROM = {
			character_event = { id = HL.10614 }
		}
	}
}

### Father guardian event
character_event = {
	id = HL.10612
	desc = EVTDESC_HL_10612
	picture = GFX_evt_guardian

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10611

		FROM = {
			character_event = { id = HL.10613 }
		}
	}

	option = {
		name = EVTOPTB_HL_10611

		FROM = {
			character_event = { id = HL.10614 }
		}
	}
}

### Ward is told tales of his fathers deeds
character_event = {
	id = HL.10613
	desc = EVTDESC_HL_10613
	picture = GFX_evt_steppe_mercenaries

	is_triggered_only = yes

	option = {
		name = EVTOPTA_HL_10613

		add_character_modifier = {
			name = mercenary_traditions
			duration = -1
		}
	}
}

### Ward is refused the tales of his father
character_event = {
	id = HL.10614
	desc = EVTDESC_HL_10614
	picture = GFX_evt_guardian

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_HL_10614
	}
}

### Notification event for increase in mercenary size
character_event = {
	id = 10700
	desc = EVTDESC_HL_10700
	picture = GFX_evt_steppe_mercenaries

	is_triggered_only = yes # increase_mercenary_size, mercenary_decisions.txt

	only_capable = yes

	option = {
		name = EVTOPTA_HL_10700

		custom_tooltip = { text = EVTOPTA_HL_10700_TOOLTIP }
	}
}

### Notification event for wasting money on debauchery
character_event = {
	id = 10701
	desc = EVTDESC_HL_10701
	picture = GFX_evt_steppe_mercenaries

	is_triggered_only = yes # carousing_with_the_men. mercenary_decisions.txt

	only_capable = yes

	option = {
		name = EVTOPTA_HL_10701

		tooltip = {
			FROM = {
				show_scope_change = no

				wealth = -25
				prestige = 10
			}
		}
	}
}