namespace = byzsla_slavic_event_chors

############################
#### Pęknięta korona
#byzsla_slavic_event_chors.1 - Pęknięcie
#byzsla_slavic_event_chors.2 - Koszmar
#byzsla_slavic_event_chors.3 - Wzrost ekonomii
#byzsla_slavic_event_chors.4 - Wzrost intryg
#byzsla_slavic_event_chors.5 - Wielki biznes?
#byzsla_slavic_event_chors.6 - Udany deal
#byzsla_slavic_event_chors.7 - Nieudany deal
#byzsla_slavic_event_chors.8 - Wrogość plebsu
#byzsla_slavic_event_chors.9 - Wrogość elit
#byzsla_slavic_event_chors.10 - Randomy
#byzsla_slavic_event_chors.11 - Samoczynna naprawa
#byzsla_slavic_event_chors.12 - Likwidacja po śmierci
#### Dziecko księżyca
#byzsla_slavic_event_chors.13 - Chorowite dziecko (inicjacja)
#byzsla_slavic_event_chors.14 - Kapłan akceptuje
#byzsla_slavic_event_chors.15 - Kapłan odrzuca
#byzsla_slavic_event_chors.16 - Chorowite dziecko (info)
############################

#### Pęknięta korona

#byzsla_slavic_event_chors.1 - Pęknięcie


long_character_event  = {
	id = byzsla_slavic_event_chors.1
	desc = desc_byzsla_slavic_event_chors.1
	
	picture = GFX_evt_bad_news
	religion_group = pagan_group
	
	trigger = {
		is_ruler = yes
		prisoner = no
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		has_regent = no
		is_slav_religion = yes
		NOT = { has_artifact = bspm_peknieta_korona }
		NOT = { has_character_flag = bspm_peknieta_korona_flaga }
		NOT = { has_character_flag = bspm_peknieta_korona_flaga2 }
	}
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.1	#Zaakceptuję dar księżyca
		set_character_flag = bspm_peknieta_korona_flaga
		add_artifact = bspm_peknieta_korona
		scaled_prestige = { value = -0.5 min = -10 } 
		scaled_piety = { value = 0.8 min = 20 } 
		character_event = {
			id = byzsla_slavic_event_chors.10
			days = 200
			random = 100
		}
	}
	option = {
		name = optB_byzsla_slavic_event_chors.1	#To jest afront - naprawię to
		scaled_wealth = -0.01
		prestige = 35
		piety = -30
		set_character_flag = bspm_peknieta_korona_flaga
		hidden_tooltip = {
			random = {
				chance = 50
				long_character_event = {
					id = byzsla_slavic_event_chors.2
					days = 60
					random = 30
				}
			}
		}
	}
}

#byzsla_slavic_event_chors.2 - Koszmar

long_character_event  = {
	id = byzsla_slavic_event_chors.2
	desc = desc_byzsla_slavic_event_chors.2
	
	picture = GFX_evt_byzla_gamajun
	religion_group = pagan_group
	
	trigger = {
		is_ruler = yes
		prisoner = no
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		has_regent = no
		is_slav_religion = yes
		NOT = { has_artifact = bspm_peknieta_korona }
		has_character_flag = bspm_peknieta_korona_flaga
		NOT = { has_character_flag = bspm_peknieta_korona_flaga2 }
	}
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.2	#Bo wielbię Słońce
		trigger = {
			has_character_modifier = follower_of_swarog
		}
		set_character_flag = bspm_peknieta_korona_flaga2
		piety = 30
		prestige = 30
		change_stewardship = 1
	}
	option = {
		name = optB_byzsla_slavic_event_chors.2	#Jako drapieżnik księżyc mi nie potrzebny
		trigger = {
			has_character_modifier = follower_of_berstuk
		}
		set_character_flag = bspm_peknieta_korona_flaga2
		piety = 30
		prestige = 30
		health = 1
	}
	option = {
		name = optC_byzsla_slavic_event_chors.2	#Wszystkiego wiedzieć nie mogę
		trigger = {
			religion = chram_roda
			learning = 10
		}
		set_character_flag = bspm_peknieta_korona_flaga2
		piety = 90
		random = {
			chance = 15
			change_learning = 1
		}
	}
	option = {
		name = optD_byzsla_slavic_event_chors.2	#Cóż pocznę?
		trigger = {
			NOT = {
				OR = {
					AND = {
						religion = chram_roda
						learning = 10
					}
					has_character_modifier = follower_of_berstuk
					has_character_modifier = follower_of_swarog
				}
			}
		}
		set_character_flag = bspm_peknieta_korona_flaga2
		random = {
			chance = 20
			change_learning = -1
			prestige = 50
		}
	}
}

#byzsla_slavic_event_chors.3 - Wzrost ekonomii

character_event = {
	id = byzsla_slavic_event_chors.3
	desc = desc_byzsla_slavic_event_chors.3
	
	picture = GFX_evt_recovery
	religion_group = pagan_group
	
	trigger = {
		is_ruler = yes
		prisoner = no
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		has_regent = no
		is_slav_religion = yes
		has_artifact = bspm_peknieta_korona
	}
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.3
		if = {
			limit = {
				NOT = { religion = chram_roda }
			}
			random_list = {
				10 = { piety = 10 }
				10 = { piety = 20 }
				10 = { piety = 30 }
			}
		}
		random = {
			chance = 33
			change_stewardship = 1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_chors.3
		if = {
			limit = {
				NOT = { religion = chram_roda }
			}
			piety = -35
		}
		random = {
			chance = 75
			change_stewardship = 1
		}
	}
	option = {
		name = optC_byzsla_slavic_event_chors.3	#dla Swarogowca
		trigger = {
			has_character_modifier = follower_of_swarog
		}
		piety = 50
		add_character_modifier = {
			name = byzsla_swarog_chors
			duration = 500
		}
	}
	option = {
		name = optD_byzsla_slavic_event_chors.3	#dla Marzanny
		trigger = {
			has_character_modifier = follower_of_swarog
		}
		add_character_modifier = {
			name = byzsla_moerna_chors
			duration = 500
		}
	}
}

#byzsla_slavic_event_chors.4 - Wzrost intryg

character_event = {
	id = byzsla_slavic_event_chors.4
	desc = desc_byzsla_slavic_event_chors.4
	
	picture = GFX_evt_shadow
	religion_group = pagan_group
	
	trigger = {
		is_ruler = yes
		prisoner = no
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		has_regent = no
		is_slav_religion = yes
		has_artifact = bspm_peknieta_korona
	}
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.4	
		random = {
			chance = 75
			change_intrigue = 1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_chors.4
		destroy_artifact = bspm_peknieta_korona
		scaled_prestige = { value = -0.1 min = -10 }
		random = {
			chance = 33
			add_trait = paranoid
		}
		if = {
			limit = {
				trait = craven
			}
			health = 1
		}
	}
}

#byzsla_slavic_event_chors.5 - Wielki biznes?

character_event = {
	id = byzsla_slavic_event_chors.5
	desc = desc_byzsla_slavic_event_chors.5
	
	picture = GFX_evt_market
	religion_group = pagan_group
	
	trigger = {
		is_ruler = yes
		prisoner = no
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
		has_regent = no
		is_slav_religion = yes
		has_artifact = bspm_peknieta_korona
	}
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.5
		prestige = -50
		hidden_tooltip = {
			random_list = {
				50 = { character_event = { id = byzsla_slavic_event_chors.6 days = 100 random = 15 } }
				50 = { character_event = { id = byzsla_slavic_event_chors.7 days = 100 random = 15 } }
			}
			add_character_modifier = {
				name = disloyal_peasantry
				duration = 150
			}
			add_character_modifier = {
				name = impious_teachings
				duration = 720
			}
		}
		custom_tooltip = {
			text = TT_byzsla_slavic_event_chors.5
		}
	}
	option = {
		name = optB_byzsla_slavic_event_chors.5
		add_character_modifier = {
			name = byzsla_chors_study
			duration = 720
		}
	}
}

#byzsla_slavic_event_chors.6 - Udany deal

character_event = {
	id = byzsla_slavic_event_chors.6
	desc = desc_byzsla_slavic_event_chors.6
	
	picture = GFX_evt_market
	religion_group = pagan_group
		
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.6
		scaled_wealth = { value = 3.0 min = 50 }
		economy_techpoints = 50
		random = {
			chance = 1
			add_trait = lunatic
		}
	}
}

#byzsla_slavic_event_chors.7 - Nieudany deal

character_event = {
	id = byzsla_slavic_event_chors.7
	desc = desc_byzsla_slavic_event_chors.7
	
	picture = GFX_evt_market
	#religion_group = pagan_group
		
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.7
		economy_techpoints = 10
	}
}

#byzsla_slavic_event_chors.8 - Wrogość plebsu

character_event = {
	id = byzsla_slavic_event_chors.8
	desc = desc_byzsla_slavic_event_chors.8
	
	trigger = {
		has_artifact = bspm_peknieta_korona
		is_slav_religion = yes
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
	}
	
	picture = GFX_evt_bad_news
	#religion_group = pagan_group
		
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.8
		add_character_modifier = {
			name = disloyal_peasantry
			duration = 720
		}
	}
}

#byzsla_slavic_event_chors.9 - Wrogość elit

character_event = {
	id = byzsla_slavic_event_chors.9
	desc = desc_byzsla_slavic_event_chors.9
	
	trigger = {
		has_artifact = bspm_peknieta_korona
		is_slav_religion = yes
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
	}
	
	picture = GFX_evt_bad_news
	religion_group = pagan_group
		
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.8
		any_vassal = {
			opinion = { who = ROOT modifier = opinion_offended years = 10 }
		}
	}
}

#byzsla_slavic_event_chors.10 - Randomy

character_event = {
	id = byzsla_slavic_event_chors.10

	is_triggered_only = yes
	hide_window = yes
	
	trigger = {
		has_artifact = bspm_peknieta_korona
		is_slav_religion = yes
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
	}
	
	immediate = {
		character_event = { id = byzsla_slavic_event_chors.10 days = 500 random = 90 }
		random_list = {
			10 = {
				character_event = { id = byzsla_slavic_event_chors.11 days = 250 random = 30 }
			}
			20 = {
				random_list = {
					40 = {
						character_event = {
							id = byzsla_slavic_event_chors.3
						}
					}
					40 = {
						character_event = {
							id = byzsla_slavic_event_chors.4
						}
					}
					40 = {
						character_event = {
							id = byzsla_slavic_event_chors.5
						}
					}
					#wrogi tłum
					20 = {
						character_event = {
							id = byzsla_slavic_event_chors.9
						}
					}
					20 = {
						character_event = {
							id = byzsla_slavic_event_chors.8
						}
					}
					#Nic
					100 = {
						#noTHING
					}
				}
			}
		}
	}
}

#byzsla_slavic_event_chors.11 - Samoczynna naprawa

character_event = {
	id = byzsla_slavic_event_chors.11
	desc = desc_byzsla_slavic_event_chors.11
	
	picture = GFX_evt_recovery
	religion_group = pagan_group

	trigger = {
		has_artifact = bspm_peknieta_korona
		is_slav_religion = yes
		NOT = { trait = in_hiding }
		NOT = { trait = incapable }
	}
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.11
		destroy_artifact = bspm_peknieta_korona
		prestige = 120
		piety = 120
	}
}

character_event = {
	id = byzsla_slavic_event_chors.12
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		has_artifact = bspm_peknieta_korona
	}
	immediate = {
		destroy_artifact = bspm_peknieta_korona
	}
}

#byzsla_slavic_event_chors.13 - Chorowite dziecko

character_event = {
	id = byzsla_slavic_event_chors.13
	hide_window = yes
	is_triggered_only = yes
	
	religion_group = pagan_group
	
	trigger = {
		OR = {
			mother = { 
				is_slav_religion = yes 
				is_ruler = yes
			}
			father = { 
				is_slav_religion = yes 
				is_ruler = yes
			}
		}
		NOT = { 
			trait = byzsla_child_chors
			has_character_flag = byzsla_child_chors_flaga1
			has_character_flag = byzsla_child_chors_flaga2
		}
		OR = {
			trait = sickly
			trait = weak
		}
	}
	immediate = {
		set_character_flag = byzsla_child_chors_flaga1
		if = {
			limit = {
				father = {
					is_slav_religion = yes 
					is_ruler = yes
					NOT = { AI = yes }
				}
			}
			father = {
				character_event = {
					id = byzsla_slavic_event_chors.16
#					days = 100
#					random = 100
				}
			}
			break = yes
		}
		if = {
			limit = {
				mother = {
					is_slav_religion = yes 
					is_ruler = yes
					NOT = { AI = yes }
				}
			}
			mother = {
				character_event = {
					id = byzsla_slavic_event_chors.16
					days = 720
					random = 360
				}
			}
			break = yes
		}
		if = {
			limit = {
				father = {
					is_slav_religion = yes 
					is_ruler = yes
					AI = yes
				}
			}
			father = {
				character_event = {
					id = byzsla_slavic_event_chors.16
					days = 720
					random = 360
				}
			}
			break = yes
		}
		if = {
			limit = {
				mother = {
					is_slav_religion = yes 
					is_ruler = yes
					AI = yes
				}
			}
			mother = {
				character_event = {
					id = byzsla_slavic_event_chors.16
					days = 720
					random = 360
				}
			}
			break = yes
		}
	}
}

#byzsla_slavic_event_chors.14 - Kapłan akceptuje
#byzsla_slavic_event_chors.15 - Kapłan odrzuca

#byzsla_slavic_event_chors.16 - Chorowite dziecko (info)

character_event = {
	id = byzsla_slavic_event_chors.16
	desc = desc_byzsla_slavic_event_chors.16
	
	picture = GFX_evt_illness
	religion_group = pagan_group

	trigger = {
		is_slav_religion = yes 
		is_ruler = yes
		any_child = {
			NOT = { 
				trait = byzsla_child_chors
				has_character_flag = byzsla_child_chors_flaga2
			}
			has_character_flag = byzsla_child_chors_flaga1
			OR = {
				trait = sickly
				trait = weak
			}
		}
	}
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_chors.16
		prestige = -100
		wealth = -10
		FROM = {
			add_trait = byzsla_child_chors
			piety = 100
			set_character_flag = byzsla_child_chors_flaga2
		}
		hidden_tooltip = {
			random_realm_character = {
				limit = {
					is_priest = yes
					ai = yes
				}
				wealth = 10
			}
		}
	}
	option = {
		name = optB_byzsla_slavic_event_chors.16
		FROM = {
			set_character_flag = byzsla_child_chors_flaga2
			random_list = {
				70 = { health = -1 }
				30 = { health = 1 }
			}
			prestige = 50
		}
	}
	option = {
		name = optC_byzsla_slavic_event_chors.16
		trigger = {
			OR = {
				is_evil_trigger = yes
				religion = chram_vales
			}
		}
		prestige = 100
		piety = 100
		add_character_modifier = {
			name = the_ruthless
			duration = 3650
		}
		FROM = {
			set_character_flag = byzsla_child_chors_flaga2
			random_list = {
				80 = { health = -1 }
				20 = { health = -1 }
			}
			prestige = -50
		}
	}
}