namespace = OSS

#Birth rites

character_event = {
	id = OSS.1
	hide_window = yes
	
	is_triggered_only = yes
	
	trigger = {
		OR = {
			religion = ossetian_pagan
			has_religion_feature = religion_feature_ossetian
		}
		is_alive = yes
	}
	
	immediate = {
		if = {
			limit = {
				father = {
					is_alive = yes
				}
			}
			father = {
				character_event = {
					id = OSS.2
					days = 1
				}
			}
		}
		if = {
			limit = {
				father = {
					is_alive = no
				}
			}
			mother = {
				character_event = {
					id = OSS.2
					days = 1
				}
			}
		}
	}
}

character_event = {
	id = OSS.2
	desc = {
		text = "EVTDESCOSS2A"
		trigger = {
			is_female = no
		}
	}
	desc = {
		text = "EVTDESCOSS2B"
		trigger = {
			is_female = yes
		}
	}
	picture = GFX_evt_tribal_shrine
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				is_landed = no
			}
			liege = {
				character_event = {
					id = OSS.3
					days = 1
				}
			}
		}
	}
			
	
	option = {
		ai_chance = {
			factor = 3
		}
		name = "EVTOPTAOSS2"
		piety = 10
		FROM = {
			add_character_modifier = {
				name = small_birth_sacrifices
				years = 16
			}
		}
		if = {
			limit = {
				is_landed = no
			}
			wealth = -5
		}
		if = {
			limit = {
				is_landed = yes
			}
			scaled_wealth = -0.25
		}	
		if = {
			limit = {
				is_landed = no
			}
			set_character_flag = exepect_minor_payment_from_liege
			custom_tooltip = {
				text = "EVTTTOSS2"
			}
		}
	}
	option = {
		ai_chance = {
			factor = 3
		}
		name = "EVTOPTBOSS2"
		piety = 30
		FROM = {
			add_character_modifier = {
				name = average_birth_sacrifices
				years = 16
			}
		}	
		if = {
			limit = {
				is_landed = no
			}
			wealth = -10
		}
		if = {
			limit = {
				is_landed = yes
			}
			scaled_wealth = -0.5
		}
		if = {
			limit = {
				is_landed = no
			}
			set_character_flag = exepect_normal_payment_from_liege
			custom_tooltip = {
				text = "EVTTTOSS2"
			}
		}
	}
	option = {
		ai_chance = {
			factor = 2
			modifier = {
				factor = 10
				trait = charitable
			}
		}
		name = "EVTOPTCOSS2"
		piety = 50
		FROM = {
			add_character_modifier = {
				name = large_birth_sacrifices
				years = 16
			}
		}
		if = {
			limit = {
				is_landed = no
			}
			wealth = -15
		}
		if = {
			limit = {
				is_landed = yes
			}
			scaled_wealth = -1
		}
		if = {
			limit = {
				is_landed = no
			}
			set_character_flag = exepect_large_payment_from_liege
			custom_tooltip = {
				text = "EVTTTOSS2"
			}
		}	
	}
	option = {
		ai_chance = {
			factor = 1
			modifier = {
				factor = 10
				trait = greedy
			}
		}
		name = "EVTOPTDOSS2"
		piety = -50			
	}
}

character_event = {
	id = OSS.3
	desc = EVTDESCOSS3
	picture = GFX_evt_tribal_shrine
	
	is_triggered_only = yes
	
	option = {
		ai_chance = {
			factor = 10
			modifier = {
				factor = 10
				trait = charitable
			}
		}
		name = "EVTOPTAOSS3"
		if = {
			limit = {
				FROM = {
					has_character_flag = exepect_minor_payment_from_liege
				}
			}
			transfer_scaled_wealth = {
				to = FROM
				value = 100
				min = 5
				max = 5
			}
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = exepect_normal_payment_from_liege
				}
			}
			transfer_scaled_wealth = {
				to = FROM
				value = 100
				min = 10
				max = 10
			}
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = exepect_large_payment_from_liege
				}
			}
			transfer_scaled_wealth = {
				to = FROM
				value = 100
				min = 15
				max = 15
			}
		}
		FROM = {
			clr_character_flag = exepect_large_payment_from_liege
			clr_character_flag = exepect_minor_payment_from_liege
			clr_character_flag = exepect_normal_payment_from_liege
		}
	}
	option = {
		ai_chance = {
			factor = 1
			modifier = {
				factor = 15
				trait = greedy
			}
		}
		name = "EVTOPTBOSS3"
		FROM = {
			clr_character_flag = exepect_large_payment_from_liege
			clr_character_flag = exepect_minor_payment_from_liege
			clr_character_flag = exepect_normal_payment_from_liege
		}
	}
}