namespace = byzsla_slavic_event_tryglaw

############################
# Testy konia (do Arkony)
#####
# byzsla_slavic_event_swiatowid.1 - start
# byzsla_slavic_event_swiatowid.2 - zniszczenia 1
# byzsla_slavic_event_swiatowid.3 - zniszczenia 2
# byzsla_slavic_event_swiatowid.4 - zniszczenia 3
# byzsla_slavic_event_swiatowid.5 - zniszczenia 4
#####
# Dziecięce problemy
#####
# byzsla_slavic_event_swiatowid.6 - wielka bójka dzieci
# byzsla_slavic_event_swiatowid.7 - dziecko-tryglaw szaleje
############################

character_event = {
	id = byzsla_slavic_event_tryglaw.1
	desc = desc_byzsla_slavic_event_tryglaw.1
	
	picture = GFX_evt_balwan
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.1
		custom_tooltip = {
			text = byzsla_slavic_event_swiatowid.1_TT
		}
		hidden_tooltip = {
			random_list = {
				30 = { 
					character_event = {
						id = byzsla_slavic_event_tryglaw.2		#zniszczenia po obu stronach
						days = 4
					}
				}
				30 = { 
					character_event = {
						id = byzsla_slavic_event_tryglaw.3		#zniszczenia po naszej stronie
						days = 4
					}
				}
				30 = { 
					character_event = {
						id = byzsla_slavic_event_tryglaw.4		#zniszczenia po stronie wroga
						days = 4
					}
				}
				30 = { 
					character_event = {
						id = byzsla_slavic_event_tryglaw.5		#relatywny spokój
						days = 4
					}
				}
			}
		}
	}
}

character_event = {
	id = byzsla_slavic_event_tryglaw.2
	desc = desc_byzsla_slavic_event_tryglaw.2
	
	picture = GFX_evt_balwan
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.2
		add_character_modifier = {
			name = byzsla_slav_tryglaw_zniszcz_oba
			duration = 1000
		}
		random_courtier_or_vassal = {
			limit = {
				has_minor_title = title_commander
			}
			add_character_modifier = {
				name = byzsla_slav_tryglaw_zniszcz_oba
				duration = 1000
			}
		}
	}
}
character_event = {
	id = byzsla_slavic_event_tryglaw.3
	desc = desc_byzsla_slavic_event_tryglaw.3
	
	picture = GFX_evt_balwan
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.2
		add_character_modifier = {
			name = byzsla_slav_tryglaw_zniszcz_my
			duration = 1000
		}
		random_courtier_or_vassal = {
			limit = {
				has_minor_title = title_commander
			}
			add_character_modifier = {
				name = byzsla_slav_tryglaw_zniszcz_my
				duration = 1000
			}
		}
	}
}
character_event = {
	id = byzsla_slavic_event_tryglaw.4
	desc = desc_byzsla_slavic_event_tryglaw.4
	
	picture = GFX_evt_balwan
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.2
		add_character_modifier = {
			name = byzsla_slav_tryglaw_zniszcz_oni
			duration = 1000
		}
		random_courtier_or_vassal = {
			limit = {
				has_minor_title = title_commander
			}
			add_character_modifier = {
				name = byzsla_slav_tryglaw_zniszcz_oni
				duration = 1000
			}
		}
	}
}
character_event = {
	id = byzsla_slavic_event_tryglaw.5
	desc = desc_byzsla_slavic_event_tryglaw.5
	
	picture = GFX_evt_balwan
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.2
		add_character_modifier = {
			name = byzsla_slav_tryglaw_zniszcz_nikt
			duration = 1000
		}
		random_courtier_or_vassal = {
			limit = {
				has_minor_title = title_commander
			}
			add_character_modifier = {
				name = byzsla_slav_tryglaw_zniszcz_nikt
				duration = 1000
			}
		}
	}
}

# byzsla_slavic_event_swiatowid.6 - wielka bójka dzieci

long_character_event = {
	id = byzsla_slavic_event_tryglaw.6
	desc = desc_byzsla_slavic_event_tryglaw.6
	
	picture = GFX_evt_child_bully
	is_triggered_only = yes
	
	trigger = {
		is_ruler = yes
		is_slav_religion = yes
		NOT = { religion = slavic_pagan }
		any_courtier = {
			count = 3
			age = 8
			NOT = { age = 15 }
		}
		NOT = {
			any_courtier = {
				 OR = {
					has_character_flag = byzsla_dzieci_biją
					has_character_flag = byzsla_dzieci_biją_tryglaw
				 }
			}
		}
	}
	
	immediate = {
		any_courtier = {
			limit = {
				age = 8
				NOT = { age = 15 }
			}
			set_character_flag = byzsla_dzieci_biją
		}
		random_courtier = {
			limit = {
				age = 8
				NOT = { age = 15 }
			}
			set_character_flag = byzsla_dzieci_biją_tryglaw
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.6
		any_courtier = {
			limit = { has_character_flag = byzsla_dzieci_biją }
			random = {
				chance = 25
				add_trait = wounded
			}
			random_list = {
				10 = { change_martial = 1 }
				10 = { change_martial = 2 }
				10 = { 
					change_martial = 1 
					change_learning = -1
				}
				10 = { 
					change_martial = 2
					change_learning = -2
				}
			}	
			hidden_tooltip = {
				if = {
					limit = { NOT = { religion = slavic_pagan_reformed } }
					random = {
						chance = 14
						set_secret_religion = slavic_pagan_reformed
					}
				}
				if = {
					limit = { NOT = { religion = chram_vales } }
					random = {
						chance = 14
						set_secret_religion = chram_vales
					}
				}
			}
		}
		random_courtier = {
			limit = {
				has_character_flag = byzsla_dzieci_biją_tryglaw
			}
			hidden_tooltip = {
				if = {
					limit = { NOT = { religion = chram_vales } }
					random = {
						chance = 20
						set_secret_religion = chram_vales
					}
				}
			}
			random = {
				chance = 35
				add_trait = wounded
			}
			random_list = {
				10 = { change_martial = 1 }
				15 = { change_martial = 2 }
			}	
		}
	}
	option = {
		name = optB_byzsla_slavic_event_tryglaw.6
		random_courtier_or_vassal = {
			limit = {
				is_priest = yes
			}
			opinion = {
				modifier = opinion_grateful
				who = ROOT
			}
		}
		any_courtier = {
			limit = { has_character_flag = byzsla_dzieci_biją }
			random = {
				chance = 25
				add_trait = wounded
			}
			random_list = {
				10 = { change_martial = 1 }
				10 = { 
					change_learning = 1
					change_martial = -1
				}
				20 = {  }
			}
			random = {
				chance = 10
				add_trait = zealous
			}
			hidden_tooltip = {
				if = {
					limit = { NOT = { religion = slavic_pagan_reformed } }
					random = {
						chance = 9
						set_secret_religion = slavic_pagan_reformed
					}
				}
				if = {
					limit = { NOT = { religion = chram_vales } }
					random = {
						chance = 9
						set_secret_religion = chram_vales
					}
				}
			}
		}
		random_courtier = {
			limit = {
				has_character_flag = byzsla_dzieci_biją_tryglaw
			}
			hidden_tooltip = {
				if = {
					limit = { NOT = { religion = chram_vales } }
					random = {
						chance = 20
						set_secret_religion = chram_vales
					}
				}
				random = {
					chance = 10
					character_event = {
						id = byzsla_slavic_event_tryglaw.7
						days = 1000
						random = 1000
					}
				}
			}
			random = {
				chance = 35
				add_trait = wounded
			}
			random_list = {
				10 = { change_martial = 1 }
				10 = { 
					change_learning = 1 
					add_trait = zealous
				}
				20 = {  }
			}	
		}
	}
}

character_event = {
	id = byzsla_slavic_event_tryglaw.7
	desc = desc_byzsla_slavic_event_tryglaw.7
	
	picture = GFX_evt_lunatic
	is_triggered_only = yes
	
	trigger = {
		has_character_flag = byzsla_dzieci_biją_tryglaw
		NOT = { has_character_flag = byzsla_dzieci_biją_tryglaw_koniec_1 }
		NOT = { trait = lunatic }
		NOT = { trait = possessed }
	}
	
	immediate = {
		character_event = {
			id = byzsla_slavic_event_tryglaw.8
			days = 1000
			random = 1000
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.7
		set_character_flag = byzsla_dzieci_biją_tryglaw_koniec_1
		add_trait = lunatic
	}
	option = {
		name = optB_byzsla_slavic_event_tryglaw.7
		set_character_flag = byzsla_dzieci_biją_tryglaw_koniec_1
		add_trait = possessed
	}
	option = {
		name = optC_byzsla_slavic_event_tryglaw.7
		set_character_flag = byzsla_dzieci_biją_tryglaw_koniec_1
		health = -1
		random = {
			chance = 30
			add_trait = stressed 
		}
	}
}

character_event = {
	id = byzsla_slavic_event_tryglaw.8
	desc = desc_byzsla_slavic_event_tryglaw.8
	
	picture = GFX_evt_lunatic
	is_triggered_only = yes
	
	trigger = {
		has_character_flag = byzsla_dzieci_biją_tryglaw
		has_character_flag = byzsla_dzieci_biją_tryglaw_koniec_1
		OR = {
			trait = lunatic
			trait = possessed
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_tryglaw.8
		add_character_modifier = {
			name = byzsla_slav_tryglaw_zanurzenie_chaosu
			duration = -1
		}
		if = {
			limit = { trait = shy }
			remove_trait = shy
		}
	}
	option = {
		name = optB_byzsla_slavic_event_tryglaw.8
		add_character_modifier = {
			name = byzsla_slav_tryglaw_glos_chaosu
			duration = -1
		}
		if = {
			limit = { trait = arbitrary }
			remove_trait = arbitrary
		}
	}
}
