###################################
#
# Events for Battles and Sieges
#
# Id 9900-9999 is reserved
#
###################################
#
# Written by Niklas Strid


##### Battle Events #####

# Misguided warrior
character_event = {
	id = 9900
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9900"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { education_traits = 1 }
	}
	
	option = {
		name = "EVTOPTA9900"
		add_trait = misguided_warrior
	}
}

# Tough soldier
character_event = {
	id = 9901
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9901"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { education_traits = 1 }
	}
	
	option = {
		name = "EVTOPTA9901"
		add_trait = tough_soldier
	}
}

# Skilled tactician
character_event = {
	id = 9902
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9902"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { education_traits = 1 }
	}
	
	option = {
		name = "EVTOPTA9902"
		add_trait = skilled_tactician
	}
}

# Brilliant strategist
character_event = {
	id = 9903
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9903"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { education_traits = 1 }
	}
	
	option = {
		name = "EVTOPTA9903"
		add_trait = brilliant_strategist
	}
}

# Brave - battle won
character_event = {
	id = 9904
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9904"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = brave }
		NOT = { trait = craven }
	}
	
	option = {
		name = "EVTOPTA9904"
		add_trait = brave
	}
}

# Brave - battle lost
character_event = {
	id = 9905
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9905"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = brave }
		NOT = { trait = craven }
	}
	
	option = {
		name = "EVTOPTA9905"
		add_trait = brave
	}
}

# Craven
character_event = {
	id = 9906
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9906"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = craven }
		NOT = { trait = brave }
	}
	
	option = {
		name = "EVTOPTA9906"
		add_trait = craven
	}
}

# Pneumonic
character_event = {
	id = 9907
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9907"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = pneumonic }
	}
	
	option = {
		name = "EVTOPTA9907"
		add_trait = pneumonic
	}
}

# Wounded - battle won
character_event = {
	id = 9908
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9908"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = wounded }
		NOT = { trait = maimed }
	}
	
	option = {
		name = "EVTOPTA9908"
		add_trait = wounded
	}
}

# Wounded - battle lost
character_event = {
	id = 9909
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9909"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = wounded }
		NOT = { trait = maimed }
	}
	
	option = {
		name = "EVTOPTA9909"
		add_trait = wounded
	}
}

# Maimed
character_event = {
	id = 9910
	title = "EVTBATTLETITLE"
	desc = "EVTDESC9910"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = maimed }
	}
	
	option = {
		name = "EVTOPTA9910"
		add_trait = maimed
	}
}


##### Siege Events #####

# Skilled tactician
province_event = {
	id = 9911
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9911"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { education_traits = 1 }
	}
	
	option = {
		name = "EVTOPTA9911"
		add_trait = skilled_tactician
	}
}

# Brilliant strategist
province_event = {
	id = 9912
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9912"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { education_traits = 1 }
	}
	
	option = {
		name = "EVTOPTA9912"
		add_trait = brilliant_strategist
	}
}

# Tough soldier
province_event = {
	id = 9913
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9913"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { education_traits = 1 }
	}
	
	option = {
		name = "EVTOPTA9913"
		add_trait = maimed
	}
}

# Wounded
province_event = {
	id = 9914
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9914"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = wounded }
		NOT = { trait = maimed }
	}
	
	option = {
		name = "EVTOPTA9914"
		add_trait = maimed
	}
}

# Maimed
province_event = {
	id = 9915
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9915"
	
	is_triggered_only = yes
	
	trigger = {
		NOT = { trait = maimed }
		NOT = { trait = wounded }
	}
	
	option = {
		name = "EVTOPTA9915"
		add_trait = maimed
	}
}

# Moat
province_event = {
	id = 9916
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9916"
	
	trigger = {
		has_siege = yes
		has_building = moat
		NOT = { has_province_modifier = dried_out_moat }
	}
	
	mean_time_to_happen = {
		months = 1000
	}
	
	option = {
		name = "EVTOPTA9916"
		add_province_modifier = {
			name = dried_out_moat
			duration = 180
		}
	}
}

# Palisade
province_event = {
	id = 9917
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9917"
	
	trigger = {
		has_siege = yes
		has_building = eartwork_and_palisade
		NOT = { has_province_modifier = burnt_down_palisade }
	}
	
	mean_time_to_happen = {
		months = 1000
	}

	option = {
		name = "EVTOPTA9917"
		add_province_modifier = {
			name = burnt_down_palisade
			duration = 180
		}
	}
}

# Gateway
province_event = {
	id = 9918
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9918"
	
	trigger = {
		has_siege = yes
		has_building = gateway
		NOT = { has_province_modifier = burnt_down_gateway }
	}
	
	mean_time_to_happen = {
		months = 1000
	}

	option = {
		name = "EVTOPTA9918"
		add_province_modifier = {
			name = burnt_down_gateway
			duration = 180
		}
	}
}

# Guard towers
province_event = {
	id = 9919
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9919"
	
	trigger = {
		has_siege = yes
		has_building = guard_towers
		NOT = { has_province_modifier = burnt_down_guard_towers }
	}
	
	mean_time_to_happen = {
		months = 1000
	}
 
	option = {
		name = "EVTOPTA9919"
		add_province_modifier = {
			name = burnt_down_guard_towers
			duration = 180
		}
	}
}

# Active defenders
province_event = {
	id = 9920
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9920"
	
	trigger = {
		has_siege = yes
	}
	
	mean_time_to_happen = {
		months = 1000
	}
 
	option = {
		name = "EVTOPTA9920"
		add_province_modifier = {
			name = active_defenders
			duration = 180
		}
	}
}

# Energetic commander
province_event = {
	id = 9921
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9921"
	
	trigger = {
		has_siege = yes
	}
	
	mean_time_to_happen = {
		months = 1000
	}
 
	option = {
		name = "EVTOPTA9921"
		add_province_modifier = {
			name = energetic_commander
			duration = 180
		}
	}
}

# Village damaged
province_event = {
	id = 9922
	title = "EVTSIEGETITLE"
	desc = "EVTDESC9922"
	
	trigger = {
		has_siege = yes
		OR = {
			has_building = marketplace
			has_building = guild_hall
			has_building = toll_booth
			has_building = court_house
			has_building = road_network
			has_building = windmill
			has_building = geisha_district
		}
	}
	
	mean_time_to_happen = {
		months = 1000
		
		modifier = {
			factor = 0.85
			has_building = marketplace
		}
		modifier = {
			factor = 0.85
			has_building = guild_hall
		}
		modifier = {
			factor = 0.85
			has_building = toll_booth
		}
		modifier = {
			factor = 0.85
			has_building = court_house
		}
		modifier = {
			factor = 0.85
			has_building = road_network
		}
		modifier = {
			factor = 0.85
			has_building = windmill
		}
		modifier = {
			factor = 0.85
			has_building = geisha_district
		}
	}
	
	option = {
		name = "EVTOPTA9922"
		add_city_level = -1
	}
}

# Treasury
character_event = {
	id = 9923
	desc = "EVTDESC9923"
	
	trigger = {
		war = yes
		NOT = {
			treasury = 0
		}
		honor = 30
		NOT = {
			has_character_modifier = modifier_treasury_war_timer
		}
	}
	
	mean_time_to_happen = {
		months = 240
		
		modifier = {
			factor = 0.75
			honor = 50
		}
		modifier = {
			factor = 0.5
			honor = 75
		}
	}
	
	option = {
		name = "EVTOPTA9923"
		treasury = 25
		hidden_tooltip = {
			add_character_modifier = {
				name = modifier_treasury_war_timer
				duration = 365
			}
		}
	}
}
