add_namespace = unit_leader

# General Sick
unit_leader_event = {
	id = unit_leader.1   #donotlog
	title = unit_leader.1.t
	desc = unit_leader.1.d

	is_triggered_only = yes

	option = {
		name = unit_leader.1.a
		effect_tooltip = {
			FROM = {
				add_timed_unit_leader_trait = {
					trait = sick
					days = 30
				}
			}
		}
	}
}

# General Wounded
unit_leader_event = {
	id = unit_leader.2   #donotlog
	title = unit_leader.2.t
	desc = unit_leader.2.d

	is_triggered_only = yes

	option = {
		name = unit_leader.2.a
		effect_tooltip = {
			FROM = {
				add_timed_unit_leader_trait = {
					trait = wounded
					days = 90
				}
			}
		}
	}
}


# Picking your random general event
unit_leader_event = {
	id = unit_leader.10
	immediate = { log = "[GetDateText]: [Root.GetName]: event unit_leader.10" }

	is_triggered_only = yes

	hidden = yes

	option = {
		ROOT = {
			if = {
				limit = {
					check_variable = {
						random < 0.5
						} # This makes it a 50/50
				}
				random_unit_leader = {
					limit = {
						has_unit_leader_flag = unit_leader_event
					}
					unit_leader_event = {
						id = unit_leader.1
					}
					clr_unit_leader_flag = unit_leader_event
				}
				else = {
					random_unit_leader = {
						limit = {
							has_unit_leader_flag = unit_leader_event
						}
						unit_leader_event = {
							id = unit_leader.2
						}
						clr_unit_leader_flag = unit_leader_event
					}
				}
			}
		}
	}
}
