namespace = byzsla_slavic_event_spec

#byzsla_slavic_event_spec.57 - Migracje do stolicy (wasal)

character_event = {
	id = byzsla_slavic_event_spec.57
	desc = desc_byzsla_slavic_event_spec.57
	picture = GFX_evt_slavic_tribal
	border = GFX_event_normal_frame_economy
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.57
		random_demesne_province = {
			add_province_modifier = {
				name = byzsla_stolica_2
				duration = 750
			}
		}
		prestige = -50
	}
}

#byzsla_slavic_event_spec.58 - Okazja korupcji (doradca)

character_event = {
	id = byzsla_slavic_event_spec.58
	desc = desc_byzsla_slavic_event_spec.58
	picture = GFX_evt_eavesdropping
	border = GFX_event_normal_frame_economy
	
	is_triggered_only = yes
	
	trigger = {
		liege = {
			OR = {
				bspm_tribal_monarchy = yes
				bspm_tribal_despotism = yes
			}
			wealth = 70
			NOT = {
				any_demesne_province = {
					has_province_modifier = byzsla_korupcja_plemienna
				}
			}
		}
		has_job_title = yes
		is_landed = yes
	}
	
	option = {
		name = optA_byzsla_slavic_event_spec.58
		wealth = 50
		liege = {
			custom_tooltip = {
				text = bspm_korupcja_test
				hidden_tooltip = {
					random_list = {
						70 = { character_event = { id = byzsla_slavic_event_spec.59 } }
						30 = { character_event = { id = byzsla_slavic_event_spec.60 } }
					}
				}
			}
		}
		random_list = {
			50 = { change_stewardship = -1 }
			30 = { 
				change_stewardship = -1 
				change_intrigue = 1
			}
			20 = { change_intrigue = 1 }
		}
		if = {
			limit = {
				trait = charitable
			}
			random = {
				chance = 70 
				remove_trait = charitable
			}
		}
		if = {
			limit = {
				NOT = { trait = charitable }
			}
			random = {
				chance = 30
				remove_trait = greedy
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				ai_greed = 60
			}
			modifier = {
				factor = 0
				ai_honor = 120
			}
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.58
		prestige = 30
		piety = 30
		random = {
			chance = 60
			change_stewardship = 1
		}
		random = {
			chance = 30
			change_learning = 1
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				ai_honor = 60
			}
			modifier = {
				factor = 0
				liege = {
					is_friend = ROOT
				}
			}
		}
	}
}

#byzsla_slavic_event_spec.59 - Okradziono nas (nie wiadomo kto)

character_event = {
	id = byzsla_slavic_event_spec.59
	desc = desc_byzsla_slavic_event_spec.59
	picture = GFX_evt_whispers
	border = GFX_event_normal_frame_economy
	
	is_triggered_only = yes
	hide_from = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.59
		random_demesne_province = {
			add_province_modifier = {
				name = byzsla_korupcja_plemienna
				duration = 1000
			}
		}
	}
}

#byzsla_slavic_event_spec.60 - Okradziono nas (wiadomo kto)

character_event = {
	id = byzsla_slavic_event_spec.60
	desc = desc_byzsla_slavic_event_spec.60
	picture = GFX_evt_whispers
	border = GFX_event_normal_frame_economy
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.59
		random_demesne_province = {
			add_province_modifier = {
				name = byzsla_korupcja_plemienna
				duration = 1000
			}
		}
		opinion = {
			who = FROM
			modifier = opinion_thief
			years = 10
		}
	}
}

#byzsla_slavic_event_spec.61 - Prymat prawa religijnego nad plemiennym (senior)

character_event = {
	id = byzsla_slavic_event_spec.61
	desc = desc_byzsla_slavic_event_spec.61
	picture = GFX_evt_whispers
	border = GFX_event_normal_frame_economy
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			bspm_tribal_monarchy = yes
			bspm_tribal_despotism = yes
		}
		any_vassal = {
			government = tribal_government 
			AI = yes
		}
		any_vassal = {
			government = theocracy_government
		}
	}
	immediate = {
		hidden_tooltip = {
			random_vassal = {
				limit = { 
					government = tribal_government
					AI = yes
				}
				set_character_flag = byzsla_prawo_flaga_1
				ROOT = {
					random_vassal = {
						limit = { government = theocracy_government }
						set_character_flag = byzsla_prawo_flaga_2
						add_rival = PREVPREV
					}
				}
			}
		}
	}
	option = {
		name = optA_byzsla_slavic_event_spec.61
		trigger = {
			NOT = { trait = arbitrary }
		}
		piety = 100
		prestige = -100
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_2 }
			add_favor = ROOT
			clr_character_flag = byzsla_prawo_flaga_2
			hidden_tooltip = {
				prestige = 100
			}
			opinion = {
				who = ROOT
				modifier = approves_of_my_behaviour  
				years = 3
			}
		}
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			opinion = {
				who = ROOT
				modifier = resentful_of_my_behaviour 
				years = 3
			}
			clr_character_flag = byzsla_prawo_flaga_1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.61
		trigger = {
			NOT = { trait = arbitrary }
		}
		piety = -100
		prestige = 100
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			add_favor = ROOT
			clr_character_flag = byzsla_prawo_flaga_1
			hidden_tooltip = {
				prestige = 100
			}
			opinion = {
				who = ROOT
				modifier = approves_of_my_behaviour  
				years = 3
			}
		}
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_2 }
			opinion = {
				who = ROOT
				modifier = resentful_of_my_behaviour 
				years = 3
			}
			clr_character_flag = byzsla_prawo_flaga_2
		}
	}
	option = {
		name = optC_byzsla_slavic_event_spec.61
		trigger = {
			diplomacy = 13
		}
		tooltip_info = diplomacy
		piety = 50
		prestige = 50
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			clr_character_flag = byzsla_prawo_flaga_1
		}
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_2 }
			clr_character_flag = byzsla_prawo_flaga_2
		}
	}
	option = {
		name = optD_byzsla_slavic_event_spec.61
		trigger = {
			trait = arbitrary
		}
		tooltip_info = arbitrary
		piety = 200
		prestige = 200
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			clr_character_flag = byzsla_prawo_flaga_1
			add_favor = ROOT
			add_rival = ROOT
		}
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_2 }
			clr_character_flag = byzsla_prawo_flaga_2
			add_favor = ROOT
			add_rival = ROOT
		}
	}
}

#byzsla_slavic_event_spec.62 - Nowe rody rzemieślnicze vs prawo plemienne

character_event = {
	id = byzsla_slavic_event_spec.62
	desc = desc_byzsla_slavic_event_spec.62
	picture = GFX_evt_whispers
	border = GFX_event_normal_frame_economy
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			bspm_tribal_monarchy = yes
			bspm_tribal_despotism = yes
		}
		any_vassal = {
			government = tribal_government 
			ai = yes
		}
		any_vassal = {
			is_republic = yes 
		}
	}
	immediate = {
		hidden_tooltip = {
			random_vassal = {
				limit = { 
					government = tribal_government
					AI = yes
				}
				set_character_flag = byzsla_prawo_flaga_1
				ROOT = {
					random_vassal = {
						limit = { is_republic = yes }
						set_character_flag = byzsla_prawo_flaga_2
						add_rival = PREVPREV
					}
				}
			}
		}
	}
	option = {
		name = optA_byzsla_slavic_event_spec.62
		prestige = 50
		add_character_modifier = {
			name = byzsla_starzy_OK
			duration = 1460
		}
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			add_favor = ROOT
			clr_character_flag = byzsla_prawo_flaga_1
			hidden_tooltip = {
				prestige = 100
			}
			capital_holding = {
				add_holding_modifier = {
					name = byzsla_dobre_plemiona
					duration = 1460
				}
			}
			opinion = {
				who = ROOT
				modifier = approves_of_my_behaviour  
				years = 3
			}
		}
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_2 }
			opinion = {
				who = ROOT
				modifier = resentful_of_my_behaviour 
				years = 3
			}
			capital_holding = {
				add_holding_modifier = {
					name = merchants_unhappy
					duration = 1460
				}
			}
			clr_character_flag = byzsla_prawo_flaga_2
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.62
		add_character_modifier = {
			name = byzsla_zle_plemiona
			duration = 1460
		}
		wealth = 50
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_2 }
			add_favor = ROOT
			clr_character_flag = byzsla_prawo_flaga_2
			hidden_tooltip = {
				prestige = 100
			}
			capital_holding = {
				add_holding_modifier = {
					name = stewardship_advice
					duration = 1460
				}
			}
			opinion = {
				who = ROOT
				modifier = approves_of_my_behaviour  
				years = 3
			}
		}
		random_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			opinion = {
				who = ROOT
				modifier = resentful_of_my_behaviour 
				years = 3
			}
			random = {
				chance = 30
				capital_holding = {
					add_holding_modifier = {
						name = highway_robber_band
						duration = 1460
					}
				}
			}
			clr_character_flag = byzsla_prawo_flaga_1
		}
	}
}

#byzsla_slavic_event_spec.63 - Chłopi są wkurzeni nowymi podatkami

character_event = {
	id = byzsla_slavic_event_spec.63
	desc = desc_byzsla_slavic_event_spec.63
	picture = GFX_evt_peasants
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			bspm_tribal_monarchy = yes
			bspm_tribal_despotism = yes
		}
		any_demesne_province = {
			NOT = {
				has_province_modifier = peasants_scorned
			}
		}
	}
	immediate = {
		random_demesne_province = {
			limit = {
				NOT = {
					has_province_modifier = peasants_scorned
				}
			}
			set_province_flag = byzsla_chlopki_flaga_1
		}
	}
	option = {
		name = optA_byzsla_slavic_event_spec.63
		prestige = -50
		wealth = 25
		any_vassal = {
			limit = {
				OR = {
					is_feudal = yes
					government = tribal_government
				}
				NOT = { 
					trait = peasant_leader
					is_foe = ROOT
				}
			}
			opinion = { modifier = proud_pos who = ROOT years = 5 } 
		}
		random_demesne_province = {
			limit = {
				has_province_flag = byzsla_chlopki_flaga_1
			}
			add_province_modifier = {
				name = peasants_scorned
				duration = 3650
			}
			clr_province_flag = byzsla_chlopki_flaga_1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.63
		prestige = 50
		any_vassal = {
			limit = {
				OR = {
					is_feudal = yes
					government = tribal_government
				}
				NOT = { 
					trait = peasant_leader
					is_foe = ROOT
				}
			}
			opinion = { modifier = opinion_coward who = ROOT years = 5 } 
		}
		random_demesne_province = {
			limit = {
				has_province_flag = byzsla_chlopki_flaga_1
			}
			add_province_modifier = {
				name = peasants_protected
				duration = 3650
			}
			clr_province_flag = byzsla_chlopki_flaga_1
		}
	}
}

#byzsla_slavic_event_spec.64 - Gloria rodu

character_event = {
	id = byzsla_slavic_event_spec.64
	desc = desc_byzsla_slavic_event_spec.64
	picture = GFX_evt_bitwa
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			bspm_tribal_monarchy = yes
			bspm_tribal_despotism = yes
		}
		dynastic_prestige = 200
		num_of_dynasty_members = 4
		realm_size = 10
	}
	option = {
		name = optA_byzsla_slavic_event_spec.64
		scaled_wealth = -1
		prestige = 200
		add_character_modifier = {
			name = good_times
			duration = 1080
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.64
		add_character_modifier = {
			name = good_times
			duration = 720
		}
	}
}

#byzsla_slavic_event_spec.65 - Zmuś członka rady do favoru (senior start)

character_event = {
	id = byzsla_slavic_event_spec.65
	desc = desc_byzsla_slavic_event_spec.65
	picture = GFX_evt_spymaster
	is_triggered_only = yes
	
	trigger = {
		bspm_tribal_despotism = yes
		any_courtier_or_vassal = {
			has_job_title = yes
		}
	}
	
	immediate = {
		random_courtier_or_vassal = {
			limit = {
				has_job_title = yes
			}
			set_character_flag = byzsla_prawo_flaga_1
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_spec.65
		random_courtier_or_vassal = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			character_event = {
				id = byzsla_slavic_event_spec.66
			}
			clr_character_flag = byzsla_prawo_flaga_1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.65
		random_realm_character = {
			limit = { has_character_flag = byzsla_prawo_flaga_1 }
			clr_character_flag = byzsla_prawo_flaga_1
		}
	}
}

#byzsla_slavic_event_spec.66 - Zmuś członka rady do favoru (wasal zapytanie)

character_event = {
	id = byzsla_slavic_event_spec.66
	desc = desc_byzsla_slavic_event_spec.66
	picture = GFX_evt_bandits
	is_triggered_only = yes
	
	hide_from = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.66
		FROM = {
			character_event = {
				id = byzsla_slavic_event_spec.67
			}
		}
		opinion = { modifier = opinion_loyal_servant who = FROM } 
		ai_chance = {
			factor = 90
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.66
		FROM = {
			character_event = {
				id = byzsla_slavic_event_spec.68
			}
		}
		ai_chance = {
			factor = 10
		}
	}
}

#byzsla_slavic_event_spec.67 - Zmuś członka rady do favoru (senior rezultat pozytywny)

character_event = {
	id = byzsla_slavic_event_spec.67
	desc = desc_byzsla_slavic_event_spec.67
	picture = GFX_evt_viking_throneroom_oldgods
	is_triggered_only = yes
	hide_from = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.67
		add_favor = FROM
		opinion = { modifier = opinion_loyal_servant who = FROM }
		random = {
			chance = 33
			change_intrigue = 1
		}
	}
}

#byzsla_slavic_event_spec.68 - Zmuś członka rady do favoru (senior rezultat negatywny)

character_event = {
	id = byzsla_slavic_event_spec.68
	desc = desc_byzsla_slavic_event_spec.68
	picture = GFX_evt_viking_throneroom_oldgods

	is_triggered_only = yes	
	hide_from = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.68
		FROM = {
			character_event = {
				id = byzsla_slavic_event_spec.69
			}
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.68
		random = {
			chance = 25
			add_trait = just
		}
	}
}

#byzsla_slavic_event_spec.69 - Zmuś członka rady do favoru (wasal śmierć)

character_event = {
	id = byzsla_slavic_event_spec.69
	desc = desc_byzsla_slavic_event_spec.69
	picture = GFX_evt_bandits
	is_triggered_only = yes
	
	hide_from = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.69
		death = { death_reason = death_murder_unknown } 
	}
}

#byzsla_slavic_event_spec.70 - Ambitna żona (inicjacja)

character_event = {
	id = byzsla_slavic_event_spec.70
	is_triggered_only = yes
	
	hide_window = yes
	
	only_playable = no
	only_women = yes
	is_married = yes
	
	
	trigger = {
		NOT = { has_character_flag = bspm_piast_zona_1 }
		any_spouse = {
			is_playable = yes
			NOT = { is_female = yes }
			independent = no
			government = feudal_government
			dynasty = 699
			any_liege = {
				dynasty = 699
			}
		}
	}
	
	immediate = {
		set_character_flag = bspm_piast_zona_1
		add_trait = ambitious
		any_spouse = {
			character_event = {
				id = byzsla_slavic_event_spec.71
				days = 300
				random = 1000
			}
		}
	}
}

#byzsla_slavic_event_spec.71 - Żona podbudza twoje ambicje

character_event = {
	id = byzsla_slavic_event_spec.71
	desc = desc_byzsla_slavic_event_spec.71
	picture = GFX_evt_quarrel
	is_triggered_only = yes
	
	trigger = {
		dynasty = 699
		independent = no
		government = feudal_government
		any_liege = {
			dynasty = 699
		}
		is_playable = yes
		NOT = { trait = ambitious }
		any_spouse = {
			has_character_flag = bspm_piast_zona_1
			trait = ambitious
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_spec.71
		add_trait = ambitious
		prestige = 50
		FROM = { opinion = { modifier = ambitious_pos who = ROOT years = 5 } }
	}
	option = {
		name = optB_byzsla_slavic_event_spec.71
		piety = 100
		random = {
			chance = 50
			change_diplomacy = 1
		}
		FROM = { opinion = { modifier = slothful_neg who = ROOT years = 5 } }
	}
}

#byzsla_slavic_event_spec.72 - Żona fałszuje papiery na claimy (inicjacja)

character_event = {
	id = byzsla_slavic_event_spec.72
	is_triggered_only = yes
	
	hide_window = yes
	
	only_playable = no
	only_women = yes
	is_married = yes
	
	
	trigger = {
		NOT = { has_character_flag = bspm_piast_zona_2 }
		intrigue = 11
		any_spouse = {
			is_playable = yes
			NOT = { is_female = yes }
			independent = no
			government = feudal_government
			dynasty = 699
			any_liege = {
				dynasty = 699
			}
		}
	}
	
	immediate = {
		set_character_flag = bspm_piast_zona_2
		any_spouse = {
			character_event = {
				id = byzsla_slavic_event_spec.73
				days = 300
				random = 1000
			}
		}
	}
}

#byzsla_slavic_event_spec.73 - Żona fałszuje papiery na claimy (dostanie)

character_event = {
	id = byzsla_slavic_event_spec.73
	desc = desc_byzsla_slavic_event_spec.73
	picture = GFX_evt_princess_byzantine
	is_triggered_only = yes
	
	trigger = {
		dynasty = 699
		independent = no
		government = feudal_government
		any_liege = {
			dynasty = 699
		}
		is_playable = yes
		NOT = { trait = ambitious }
		any_spouse = {
			has_character_flag = bspm_piast_zona_2
		}
		NOT = {
			liege = {
				primary_title = {
					claimed_by = ROOT
				}
			}
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_spec.73
		hidden_tooltip = {
			if = {
				limit = {
					NOT = { intrigue = 13 }
				}
				random = {
					chance = 40
					character_event = {
						id = byzsla_slavic_event_spec.74
						days = 100
						random = 300
					}
				}
			}
			if = {
				limit = {
					intrigue = 13
				}
				random = {
					chance = 25
					character_event = {
						id = byzsla_slavic_event_spec.74
						days = 130
						random = 330
					}
				}
			}
		}
		prestige = -50
		wealth = -50
		liege = {
			primary_title = {
				add_claim = ROOT
			}
		}
		FROM = { opinion = { modifier = ambitious_pos who = ROOT years = 5 } }
	}
	option = {
		name = optB_byzsla_slavic_event_spec.73
		piety = 100
		random = {
			chance = 50
			change_stewardship = 1
		}
		if = {
			limit = {
				trait = arbitrary
			}
			remove_trait = arbitrary
		}
		if = {
			limit = {
				NOT = { trait = arbitrary }
				NOT = { trait = just }
			}
			random = {
				chance = 30
				add_trait = just
			}
		}
		FROM = { opinion = { modifier = slothful_neg who = ROOT years = 5 } }
	}
}

#byzsla_slavic_event_spec.74 - Oskarżenie o oszustwo

character_event = {
	id = byzsla_slavic_event_spec.74
	desc = desc_byzsla_slavic_event_spec.74
	picture = GFX_evt_accused
	is_triggered_only = yes
	
	trigger = {
		dynasty = 699
		independent = no
		is_playable = yes
		liege = {
			primary_title = {
					claimed_by = ROOT
			}
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_spec.74
		prestige = -100
		liege = {
			character_event = {
				id = byzsla_slavic_event_spec.75
				tooltip = bspm_oskarzenie_TT
			}
			primary_title = {
				remove_claim = ROOT
			}
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.74
		trigger = {
			stewardship = 15
		}
		tooltip_info = stewardship
		scaled_wealth = -2
	}
	option = {
		name = optC_byzsla_slavic_event_spec.74
		trigger = {
			intrigue = 15
		}
		tooltip_info = intrigue
		scaled_wealth = -0.5
		add_character_modifier = {
			name = suspected_assassin
			duration = 720
		}
	}
	option = {
		name = optD_byzsla_slavic_event_spec.74
		trigger = {
			diplomacy = 18
		}
		tooltip_info = diplomacy
	}
}

#byzsla_slavic_event_spec.75 - Oskarżenie o oszustwo (senior)

character_event = {
	id = byzsla_slavic_event_spec.75
	desc = desc_byzsla_slavic_event_spec.75
	picture = GFX_evt_accused
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.75
		opinion = { modifier = opinion_traitor who = FROM years = 7 }
	}
}

#byzsla_slavic_event_spec.76 - Awanturnicy dołączają do bratobójczej wojny
character_event = {
	id = byzsla_slavic_event_spec.76
	desc = desc_byzsla_slavic_event_spec.76
	picture = "GFX_evt_battle"
	border = "GFX_event_normal_frame_war"
	
	is_triggered_only = yes
	
	trigger = {
		is_feudal = yes
		dynasty = 699
		any_war = {
			defender = { dynasty = 699 }
			attacker = { dynasty = 699 }
		}
	}
	option = {
		name = optA_byzsla_slavic_event_spec.76
		scaled_wealth = -1
		capital_scope = {
			owner = {
				spawn_unit = {
					province = PREV
					owner = THIS
					match_character = THIS
					match_mult = 0.025
					match_min = 100
					match_max = 300
					attrition = 1.0
					cannot_inherit = yes
				}
				spawn_unit = {
					province = PREV
					owner = THIS
					match_character = THIS
					match_mult = 0.025
					match_min = 100
					match_max = 300
					attrition = 1.0
					cannot_inherit = yes
				}
				spawn_unit = {
					province = PREV
					owner = THIS
					match_character = THIS
					match_mult = 0.025
					match_min = 100
					match_max = 300
					attrition = 1.0
					cannot_inherit = yes
				}
			}
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.76
		prestige = 50
	}
}

#byzsla_slavic_event_spec.77 - Żydowski specjalista

character_event = {
	id = byzsla_slavic_event_spec.77
	desc = desc_byzsla_slavic_event_spec.77
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	only_playable = yes
	min_age = 20
	only_capable = yes
	war = no
	
	trigger = {
		NOT = { has_character_modifier = expelled_jewish }
		OR = {
			any_independent_ruler = {
				has_character_modifier = expelled_jewish
			}
			k_papal_state = {
				holder_scope = {
					has_called_crusade = yes
				}
			}
		}
		any_demesne_province = {
			any_province_holding = {
				holding_type = city
			}
		}
		NOT = {
			any_demesne_province = {
				has_province_modifier = jewish_settlement_province
			}
		}
		diplomacy = 15
		NOT = { trait = zealous }
		OR = {
			AND = {
				dynasty = 699
				OR = {
					is_slav_religion = yes
					religion_group = christian
				}
			}
			AND = {
				is_slav_religion = yes
				tier = king
				independent = yes
				stewardship = 15
			}
		}
	}
	immediate = {
		create_random_steward = {
			culture = ashkenazi
			religion = jewish
			dynasty = culture
			age = 35
			random_traits = yes
			female = no
			attributes = {
				learning = 5
				stewardship = 10
				diplomacy = 7
			}
			health = 7
		}
		new_character = {
			remove_trait = temperate
			remove_trait = scholar
			remove_trait = mystic
			wealth = 100
			random_list = { # Randomize Religion
				60 = { 
					religion = jewish
				}
				10 = { 
					religion = samaritan
				}
				30 = { 
					religion = karaite
				}
			}
			if = {
				limit = { ROOT = { religion_group = pagan_group } }
				add_trait = sympathy_pagans
			}
			if = {
				limit = { ROOT = { religion_group = christian } }
				add_trait = sympathy_christendom
			}
			save_event_target_as = zydowski_mistrz
		}
	}
	option = {
		name = optA_byzsla_slavic_event_spec.77
		random_demesne_province = {
			limit = {
				any_province_holding = {
					holding_type = city
				}
				NOT = {
					has_province_modifier = jewish_settlement_province
				}
			}
			add_province_modifier = {
				name = jewish_settlement_province
				duration = 10000
			}
		}
		add_trait = sympathy_judaism
		piety = -200
		add_character_modifier = {
			name = church_unfunny
			duration = 3000
		}
		event_target:zydowski_mistrz = {
			add_friend = FROM
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.77
		piety = 100
		prestige = 50
		add_character_modifier = {
			name = popular_ruler
			duration = 1000
		}
		event_target:zydowski_mistrz = {
			death = {
				death_reason = death_missing
			}
		}
	}
	option = {
		name = optC_byzsla_slavic_event_spec.77
		trigger = {
			trait = arbitrary
		}
		tooltip_info = arbitrary
		random = {
			chance = 33
			add_trait = cynical
		}
		prestige = -50
		piety = -50
		wealth = 200
		event_target:zydowski_mistrz = {
			add_rival = FROM
			imprison = FROM
		}
	}
}

#byzsla_slavic_event_spec.78 - Rywalizacja z bratem

character_event = {
	id = byzsla_slavic_event_spec.78
	
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		father_even_if_dead = {
			NOT = { is_alive = yes }
		}
		any_liege = {
			sibling = FROM
			is_female = no
			dynasty = 699
		}
		NOT = { is_landed = yes }
		dynasty = 699
	}
	immediate = {
		any_liege = {
			limit = {
				sibling = FROM
				is_female = no
				dynasty = 699
			}
			random = {
				chance = 50
				add_rival = ROOT
				ROOT = {
					add_trait = ambitious
					change_intrigue = 4
				}
			}
		}
	}
}

#byzsla_slavic_event_spec.80 - Narodziny miast-molochów (senior)

character_event = {
	id = byzsla_slavic_event_spec.80
	desc = desc_byzsla_slavic_event_spec.80
	picture = GFX_evt_castle_construction
	border = GFX_event_normal_frame_economy
	
	mean_time_to_happen = {
		months = 200
	}
	
	trigger = {
		government = feudal_government
		tier = EMPEROR
		culture_group = east_slavic
		any_realm_province = {
			any_province_holding = {
				holding_type = city
			}
		}
		year = 1200
		NOT = {
			any_demesne_title = { has_title_flag = bspm_miasta_molochy }
		}
	}
	
	immediate = {
		primary_title = { set_title_flag = bspm_miasta_molochy }
		hidden_tooltip = {
			any_vassal = {
				character_event = {
					id = byzsla_slavic_event_spec.81
				}
			}
			any_realm_province = {
				any_province_holding = {
					limit = {
						holding_type = city
					}
					random = {
						chance = 75
						add_holding_modifier = {
							name = spm_miasta_molochy
							duration = -1
						}
					}
				}
			}
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_spec.80
		custom_tooltip = {
			text = bspm_miasta_molochy_tt
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.80
		custom_tooltip = {
			text = bspm_miasta_molochy_tt
		}
		trigger = {
			not = { trait = brave }
			not = { trait = trusting }
		}
		random = {
			chance = 25
			add_trait = paranoid
		}
		change_stewardship = 1
	}
	option = {
		name = optC_byzsla_slavic_event_spec.80
		trigger = {
			NOT = { trait = charitable }
		}
		capital_scope = {
			add_province_modifier = {
				name = high_taxes
				duration = 720
			}
		}
		random_realm_province = {
			add_province_modifier = {
				name = high_taxes
				duration = 520
			}
		}
		random_realm_province = {
			add_province_modifier = {
				name = high_taxes
				duration = 360
			}
		}
		random_list = {
			10 = { scaled_wealth = 0.2 }
			10 = { scaled_wealth = 0.5 }
			10 = { scaled_wealth = 0.7  }
			10 = { scaled_wealth = 1 }
		}
		add_trait = greedy
		custom_tooltip = {
			text = bspm_miasta_molochy_tt
		}
	}
}

#byzsla_slavic_event_spec.81 - Narodziny miast-molochów (wasale)

character_event = {
	id = byzsla_slavic_event_spec.81
	desc = desc_byzsla_slavic_event_spec.80
	picture = GFX_evt_castle_construction
	border = GFX_event_normal_frame_economy
	
	is_triggered_only = yes
	
	option = {
		name = optA_byzsla_slavic_event_spec.81
		trigger = { is_republic = yes }
		prestige = 150
		wealth = 400
		if = {
			limit = { is_merchant_republic = yes }
			random = {
				chance = 70
				add_trait = ambitious
			}
		}
		if = {
			limit = { NOT = { is_merchant_republic = yes } }
			random = {
				chance = 40
				add_trait = ambitious
			}
		}
		add_province_modifier = {
			name = friendly_innovations
			duration = 1750
		}
		primary_title = {
			set_title_flag = bspm_miasta_molochy
		}
		custom_tooltip = {
			text = bspm_miasta_molochy_tt
		}
	}
	option = {
		name = optA_byzsla_slavic_event_spec.80
		trigger = { NOT = { is_republic = yes } }
		primary_title = {
			set_title_flag = bspm_miasta_molochy
		}
		custom_tooltip = {
			text = bspm_miasta_molochy_tt
		}
	}
}
#byzsla_slavic_event_spec.82 - Monogorod
province_event = {
	id = byzsla_slavic_event_spec.82
	desc = desc_byzsla_slavic_event_spec.82
	picture = GFX_evt_bandits
	border = GFX_event_normal_frame_economy
	
	mean_time_to_happen = {
		months = 36000
		modifier = {
			factor = 0.9
			NOT = { owner = { wealth = -50 } }
		}
		modifier = {
			factor = 0.7
			NOT = { owner = { wealth = -100 } }
		}
		modifier = {
			factor = 0.5
			NOT = { owner = { wealth = -200 } }
		}
		modifier = {
			factor = 0.3
			NOT = { owner = { wealth = -300 } }
		}
		modifier = {
			factor = 0.1
			NOT = { owner = { wealth = -500 } }
		}
		modifier = {
			factor = 0.7
			NOT = { owner = { realm_diplomacy = 15 } }
		}
		modifier = {
			factor = 0.7
			NOT = { owner = { realm_diplomacy = 10 } }
		}
		modifier = {
			factor = 0.7
			NOT = { owner = { realm_diplomacy = 5 } }
		}
		
		modifier = {
			factor = 1.5
			owner = { realm_diplomacy = 20 }
		}
		modifier = {
			factor = 2.0
			owner = { realm_diplomacy = 25 }
		}

		#traits affect this
		modifier = {
			factor = 1.5
			owner = { trait = ambitious }
		}		
		modifier = {
			factor = 5.0
			owner = { trait = just }
		}		
		modifier = {
			factor = 0.5
			owner = { trait = arbitrary }
		}
		modifier = {
			factor = 0.7
			owner = { trait = greedy }
		}
		modifier = {
			factor = 0.7
			owner = { trait = cruel }
		}		
		modifier = {
			factor = 0.1
			owner = { trait = slothful }
		}
		modifier = {
			factor = 0.2
			owner = { trait = incapable }
		}
		modifier = {
			factor = 0.1
			owner = { trait = infirm }
		}
	}
	
	trigger = {
		NOT = { is_capital = yes } 
		any_province_holding = {
			holding_type = city
			has_holding_modifier = spm_miasta_molochy
		}
		NOT = { has_province_modifier = smugglers_ring }
		NOT = { has_province_modifier = thieves_guild }
	}
	
	option = {
		name = optA_byzsla_slavic_event_spec.82
		add_province_modifier = {
			name = smugglers_ring
			duration = -1
		}
		add_province_modifier = {
			name = thieves_guild
			duration = -1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_spec.82
		owner = {
			wealth = -30
		}
		random_list = {
			30 = {
				add_province_modifier = {
					name = thieves_guild
					duration = -1
				}
			}
			30 = {
				add_province_modifier = {
					name = smugglers_ring
					duration = -1
				}
			}
			20 = {
				owner = {
					prestige = 5
				}
			}
		}
	}
	option = {
		name = optC_byzsla_slavic_event_spec.82
		owner = {
			economy_techpoints = -30
		}
		random_list = {
			15 = {
				add_province_modifier = {
					name = thieves_guild
					duration = -1
				}
			}
			15 = {
				add_province_modifier = {
					name = smugglers_ring
					duration = -1
				}
			}
			40 = {
				owner = {
					prestige = 5
				}
			}
		}
	}
}

