# On victory attempt
character_event = {
	id = 200

	is_triggered_only = yes

	desc = "EVTDESC200"

	option = {
		name = "EVTOPTA200"
		hidden_tooltip = {
			any_character = {
				limit = { ai = no }
				character_event = {
					id = 201
				}
			}
		}
	}
}

character_event = {
	id = 201

	is_triggered_only = yes

	desc = "EVTDESC201"

	option = {
		name = "EVTOPTA201"
	}
}

# On victory fail
character_event = {
	id = 202

	is_triggered_only = yes

	desc = "EVTDESC202"

	option = {
		name = "EVTOPTA202"
		any_direct_vassal = {
			limit = { dynasty = ROOT }
			opinion = {
				who = ROOT
				modifier = failed_shogun_dynasty
			}
		}
		any_direct_vassal = {
			limit = { NOT = { dynasty = ROOT } }
			opinion = {
				who = ROOT
				modifier = failed_shogun
			}
		}
		hidden_tooltip = {
			any_character = {
				limit = { ai = no }
				character_event = {
					id = 203
				}
			}
		}
	}
}

character_event = {
	id = 203

	is_triggered_only = yes

	desc = "EVTDESC203"

	option = {
		name = "EVTOPTA203"
	}
}

# On siege won events
province_event = {
	id = 300
	desc = "EVTDESC300"
	
	is_triggered_only = yes

	trigger = {
		has_building = eartwork_and_palisade
		NOT = { has_building = moat }
	}
	
	option = {
		name = "EVTOPTA300"
		add_castle_level = -1
	}
}

province_event = {
	id = 301
	desc = "EVTDESC300"
	
	is_triggered_only = yes

	immediate = {
		hidden_tooltip = {
			random = {
				10 = { set_province_flag = destroy_2 }
			}
		}
	}

	trigger = {
		has_building = moat
		NOT = { has_building = gateway }
	}
	
	option = {
		name = "EVTOPTA300"
		trigger = { NOT = { has_province_flag = destroy_2 } }
		add_castle_level = -1
	}
	option = {
		name = "EVTOPTA300"
		trigger = { has_province_flag = destroy_2 }
		add_castle_level = -2
		clr_province_flag = destroy_2
	}
}

province_event = {
	id = 302
	desc = "EVTDESC300"
	
	is_triggered_only = yes

	trigger = {
		has_building = gateway
		NOT = { has_building = guard_towers }
	}

	immediate = {
		hidden_tooltip = {
			random = {
				25 = { set_province_flag = destroy_2 }
			}
		}
	}
	
	option = {
		name = "EVTOPTA300"
		trigger = { NOT = { has_province_flag = destroy_2 } }
		add_castle_level = -1
	}
	option = {
		name = "EVTOPTA300"
		trigger = { has_province_flag = destroy_2 }
		add_castle_level = -2
		clr_province_flag = destroy_2
	}
}

province_event = {
	id = 303
	desc = "EVTDESC300"
	
	is_triggered_only = yes
	
	trigger = { has_building = guard_towers }
	
	immediate = {
		hidden_tooltip = {
			random = {
				50 = { set_province_flag = destroy_2 }
			}
		}
	}
	
	option = {
		name = "EVTOPTA300"
		trigger = { NOT = { has_province_flag = destroy_2 } }
		add_castle_level = -1
	}
	option = {
		name = "EVTOPTA300"
		trigger = { has_province_flag = destroy_2 }
		add_castle_level = -2
		clr_province_flag = destroy_2
	}
}

# DEBUG
province_event = {
	id = 100000
	desc = ""
	
	is_triggered_only = yes
	
	trigger = { owner = { ai = yes } }
	
	option = {
		name = ""
	}
}
