namespace = byzsla_slavic_event_morena

############################
#	Widzenie w czasie bitwy
#### byzsla_slavic_event_morena.1 - objawienie w czasie bitwy
#### byzsla_slavic_event_morena.2 - wygrana z chwa
#### byzsla_slavic_event_morena.3 - wygrana z pogard
#### byzsla_slavic_event_morena.4 - przegrana z chwa
#### byzsla_slavic_event_morena.5 - przegrana z pogard
#	Krlowa zimy
#### byzsla_slavic_event_morena.6 - Brutalne starcia podczas topienia Marzanny (wiosna)
############################

############################
#	Anielica mierci
############################

#### byzsla_slavic_event_morena.1 - objawienie w czasie bitwy

character_event = {
	id = byzsla_slavic_event_morena.1
	desc = desc_byzsla_slavic_event_morena.1
	picture = GFX_evt_byzsla_morena_war
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		ROOT = {
			is_slav_religion = yes
			is_ruler = yes
		}
		FROMFROM = {
			NOT = { is_slav_religion = yes }
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_morena.1		#dobre
		trigger = {
			ROOT = {
				OR = {
					religion = chram_vales
					religion = old_slavic_pagan
					religion = slavic_pagan
				}
			}
		}
		add_character_modifier = {
			name = byzsla_morena_01
			duration = -1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_morena.1		#ofiarujemy randoma
		trigger = {
			ROOT = {
				OR = {
					religion = chram_vales
					religion = old_slavic_pagan
					religion = slavic_pagan
				}
				OR = {
					num_of_prisoners = 1
					AND = {
						is_playable = no
						liege = { num_of_prisoners = 1 } 
					}
				}
			}
		}
		add_character_modifier = {
			name = byzsla_morena_02
			duration = -1
		}
		piety = -50
		if = {
			limit = {
				num_of_prisoners = 1
			}
			random_courtier = {
				limit = {
					prisoner = yes
				}
				death = {
					death_reason = death_sacrificed
					killer = ROOT
				}
			}
		}
		if = {
			limit = {
				is_playable = no
				liege = { num_of_prisoners = 1 } 
			}
			liege = {
				random_courtier = {
					limit = {
						prisoner = yes
					}
					death = {
						death_reason = death_sacrificed
						killer = ROOT
					}
				}
			}
		}
	}
	option = {
		name = optC_byzsla_slavic_event_morena.1		#Przetumacz omen dla nas
		trigger = {
			ROOT = {
				NOT = { trait = zealous }
				OR = {
					religion = chram_roda
					religion = slavic_pagan_reformed
				}
			}
		}
		add_character_modifier = {
			name = byzsla_morena_02
			duration = -1
		}
		add_character_modifier = {
			name = church_unfunny
			duration = 500
		}
		piety = -50
	}
	option = {
		name = optD_byzsla_slavic_event_morena.1		#to nic wanego
		trigger = {
			ROOT = {
				NOT = { trait = zealous }
				OR = {
					religion = chram_roda
					religion = slavic_pagan_reformed
				}
			}
		}
		add_character_modifier = {
			name = byzsla_morena_03
			duration = -1
		}
	}
	option = {
		name = optE_byzsla_slavic_event_morena.1		#to blunierczy znak
		tooltip_info = zealous
		trigger = {
			ROOT = {
				trait = zealous
				OR = {
					religion = chram_roda
					religion = slavic_pagan_reformed
				}
			}
		}
		random_list = {
			50 = {
				add_character_modifier = {
					name = byzsla_morena_03
					duration = -1
				}
			}
			50 = {
				change_martial = 1
			}
		}
		random_list = {
			50 = {}
			30 = {
				piety = 100
			}
			15 = { 
				remove_trait = zealous 
				change_intrigue = 1
			}
		}
	}
}
#### byzsla_slavic_event_morena.2 - wygrana z chwa

character_event = {
	id = byzsla_slavic_event_morena.2
	desc = desc_byzsla_slavic_event_morena.2
	picture = GFX_evt_byzsla_morena_war
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		ROOT = {
			OR = {
				has_character_modifier = byzsla_morena_01
				has_character_modifier = byzsla_morena_02
			}
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_morena.2		#dobre
		ROOT = {
			remove_character_modifier = byzsla_morena_01
			remove_character_modifier = byzsla_morena_02
		}
		if = {
			limit = {
				ROOT = {
					OR = {
						religion = chram_vales
						religion = old_slavic_pagan
						religion = slavic_pagan
					}
				}
			}
			ROOT = {
				religion_authority = {
					modifier = byzsla_slavic_bitwa1
				}
			}
		}
	}
	option = {
		name = optB_byzsla_slavic_event_morena.2		#dobre
		trigger = {
			NOT = { trait = zealous }
		}
		ROOT = {
			remove_character_modifier = byzsla_morena_01
			remove_character_modifier = byzsla_morena_02
		}
		if = {
			limit = {
				ROOT = {
					OR = {
						religion = chram_vales
						religion = old_slavic_pagan
						religion = slavic_pagan
					}
				}
			}
			ROOT = {
				religion_authority = {
					modifier = byzsla_slavic_bitwa1
				}
				if = {
					limit = {
						trait = cynical
					}
					remove_trait = cynical
					piety = -50
				}
				if = {
					limit = {
						NOT = { trait = cynical }
					}
					add_trait = zealous
					piety = -50
				}
			}
		}
		if = {
			limit = {
				ROOT = {
					OR = {
						religion = chram_roda
						religion = slavic_pagan_reformed
					}
				}
			}
			ROOT = {
				random_list = {
					85 = {
						add_character_modifier = {
							name = byzsla_morena_sec_cult
							duration = 300
						}
					}
					15 = { 
						add_character_modifier = {
							name = byzsla_morena_sec_cult
							duration = 600
						}
						random = {
							chance = 50
							set_secret_religion = chram_vales
						}
					}
				}
				piety = -200
				
			}
		}
	}
}
#### byzsla_slavic_event_morena.3 - wygrana z pogard

character_event = {
	id = byzsla_slavic_event_morena.3
	desc = desc_byzsla_slavic_event_morena.3
	picture = GFX_evt_bitwa
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		ROOT = {
			has_character_modifier = byzsla_morena_03
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_morena.3		#dobre
		ROOT = {
			remove_character_modifier = byzsla_morena_03
			add_character_modifier = {
				name = realm_religious_fervor
				duration = 500
			}
			piety = 50
		}
	}
}

#### byzsla_slavic_event_morena.4 - przegrana z chwa

character_event = {
	id = byzsla_slavic_event_morena.4
	desc = desc_byzsla_slavic_event_morena.4
	picture = GFX_evt_bloody_man
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		ROOT = {
			OR = {
				has_character_modifier = byzsla_morena_01
				has_character_modifier = byzsla_morena_02
			}
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_morena.4		#niedobre
		ROOT = {
			religion_authority = {
				modifier = byzsla_slavic_bitwa2
			}
			
			remove_character_modifier = byzsla_morena_01
			remove_character_modifier = byzsla_morena_02
		}
	}
	option = {
		name = optB_byzsla_slavic_event_morena.4		#niedobre
		trigger = {
			trait = zealous
		}
		ROOT = {
			religion_authority = {
				modifier = byzsla_slavic_bitwa2
			}
			remove_character_modifier = byzsla_morena_01
			remove_character_modifier = byzsla_morena_02
			remove_trait = zealous
		}
	}
}
#### byzsla_slavic_event_morena.5 - przegrana z pogard

character_event = {
	id = byzsla_slavic_event_morena.5
	desc = desc_byzsla_slavic_event_morena.4
	picture = GFX_evt_bloody_man
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		ROOT = {
			has_character_modifier = byzsla_morena_03
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_morena.5		#dobre
		ROOT = {
			religion_authority = {
				modifier = byzsla_slavic_bitwa1
			}
			remove_character_modifier = byzsla_morena_03
			prestige = -10
		}
	}
}

#### byzsla_slavic_event_morena.6 - Brutalne starcia podczas topienia Marzanny (wiosna)

character_event = {
	id = byzsla_slavic_event_morena.6
	desc = desc_byzsla_slavic_event_morena.6
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	only_rulers = yes
	
	trigger = {
		NOT = { month = 4 }
		NOT = { has_character_modifier = byzsla_ogolny_timer }
		any_demesne_province = {
			is_slav_religion = yes
			OR = {
				NOT = { has_province_modifier = byzsla_morena_slaba }
				NOT = { has_province_modifier = byzsla_morena_silna }
			}
		}
	}
	
	immediate = {
		add_character_modifier = {
			name = byzsla_ogolny_timer
			duration = 500
			hidden = yes
		}
		random_demesne_province = {
			limit = {
				is_slav_religion = yes
			}
			set_province_flag = morena_target_1
		}
	}
	
	option = {
		name = optA_byzsla_slavic_event_morena.6		#dla nie-sowian
		trigger = {
			NOT = { is_slav_religion = yes }
		}
		random_demesne_province = {
			limit = { has_province_flag = morena_target_1 }
			random_list = {
				50 = {
					add_province_modifier = {
						name = byzsla_morena_slaba
						duration = 360
					}
				}
				50 = {
					add_province_modifier = {
						name = byzsla_morena_silna
						duration = 360
					}
				}
				30 = {  }
			}
			clr_province_flag = morena_target_1
		}
	}
	option = {
		name = optB_byzsla_slavic_event_morena.6		#spacyfikuj ich
		trigger = {
			NOT = { is_slav_religion = yes }
		}
		piety = -50
		random_demesne_province = {
			limit = { has_province_flag = morena_target_1 }
			
			add_province_modifier = {
				name = public_execution
				duration = 200
			}
			random_list = {
				15 = {
					add_province_modifier = {
						name = religious_unrest
						duration = 260
					}
				}
				30 = {  }
			}
		}
		random = {
			chance = 33
			add_trait_zealous_effect = yes
		}
	}
	option = {
		name = optC_byzsla_slavic_event_morena.6		#
		trigger = {
			is_slav_religion = yes
		}
		random_demesne_province = {
			limit = { has_province_flag = morena_target_1 }
			random_list = {
				50 = {
					add_province_modifier = {
						name = byzsla_morena_slaba
						duration = 360
					}
				}
				50 = {
					add_province_modifier = {
						name = byzsla_morena_silna
						duration = 360
					}
				}
				30 = {  }
			}
			clr_province_flag = morena_target_1
		}
	}
	option = {
		name = optD_byzsla_slavic_event_morena.6		#
		trigger = {
			owner = { is_slav_religion = yes }
		}

		random_demesne_province = {
			limit = { has_province_flag = morena_target_1 }
			random_list = {
				70 = {
					add_province_modifier = {
						name = byzsla_morena_slaba
						duration = 360
					}
				}
				20 = {
					add_province_modifier = {
						name = byzsla_morena_silna
						duration = 360
					}
				}
				30 = {  }
			}
			clr_province_flag = morena_target_1
		}
	}
	option = {
		name = optE_byzsla_slavic_event_morena.6		#
		trigger = {
			owner = { is_slav_religion = yes }
		}

		random_demesne_province = {
			limit = { has_province_flag = morena_target_1 }
			random_list = {
				20 = {
					add_province_modifier = {
						name = byzsla_morena_slaba
						duration = 360
					}
				}
				70 = {
					add_province_modifier = {
						name = byzsla_morena_silna
						duration = 360
					}
				}
				30 = {  }
			}
			clr_province_flag = morena_target_1
		}
	}
}