namespace = Plus
#reserved: Plus.2800 to Plus.2899

#######################################
# BERBER PAGAN EVENTS
# Written by Zeress
#######################################

# A new, religious Killim?
character_event = {
	id = Plus.2800
	desc = EVTDESC_Plus_2800
	picture = GFX_evt_market_kilim
	
	only_rulers = yes
	religion = berber_pagan	
	min_age = 16
	capable_only = yes
	
	trigger = {
		NOT = { has_character_flag = berber_pagan_kilim }
	}

	mean_time_to_happen = {
		months = 960
		modifier = {
			factor = 0.5
			trait = zealous
		}
		modifier = {
			factor = 2
			trait = cynical
		}
	}
	
	immediate = {
		set_character_flag = berber_pagan_kilim
	}
	
	option = { # An expensive one
		name = EVTOPTA_Plus_2800
		wealth = -50
		piety = 25
		prestige = 25
	}
	option = { # A modest one
		name = EVTOPTB_Plus_2800
		wealth = -25
		piety = 20
	}
	option = { # A cheap one
		name = EVTOPTC_Plus_2800
		wealth = -5
		piety = 5
	}
	option = { # My current one is just fine!
		name = EVTOPTD_Plus_2800
		piety = -5
	}
}

# Gambling troubles, perhaps Afri can help me
character_event = {
	id = Plus.2801
	desc = EVTDESC_Plus_2801
	picture = GFX_evt_berber_pagan_gambling
	
	only_rulers = yes
	religion = berber_pagan	
	min_age = 16
	capable_only = yes
	
	trigger = {
		NOT = { has_character_flag = blessing_of_afri_sought }
		scaled_wealth = 1
	}

	mean_time_to_happen = {
		months = 1260 # Rare for non-greedy rulers
		
		modifier = {
			factor = 0.4
			trait = greedy
		}
	}
	
	immediate = {
		set_character_flag = blessing_of_afri_sought
	}
	
	option = { # I'll take the bet and make a sacrifice to Afri
		name = EVTOPTA_Plus_2801
		wealth = -30
		
		piety = 10
		
		hidden_tooltip = {
			random_list = {
				40 = { character_event = { id = Plus.2802 } } # The gamble worked!
				60 = { character_event = { id = Plus.2803 } } # I lost even more money....
			}
		}
	}
	option = { # I'll take that bet and pray for the best
		name = EVTOPTB_Plus_2801
		
		piety = 5
		
		hidden_tooltip = {
			random_list = {
				30 = { character_event = { id = Plus.2802 } } # The gamble worked!
				70 = { character_event = { id = Plus.2803 } } # I lost even more money....
			}
		}
	}
	option = { # No, this ends here
		name = EVTOPTC_Plus_2801

		scaled_wealth = -0.5
		
		prestige = -10

		random = {
			chance = 70
			remove_trait = greedy
		}
	}
}

# The gamble worked!
character_event = {
	id = Plus.2802
	desc = EVTDESC_Plus_2802
	picture = GFX_evt_feast
	
	is_triggered_only = yes
	
	option = { # Praise Afri!
		name = EVTOPTA_Plus_2802
		scaled_wealth = 1
		prestige = 30
		piety = 10
		
		random = {
			chance = 60
			add_trait = greedy
		}
	}
}

# The gamble failed!
character_event = {
	id = Plus.2803
	desc = EVTDESC_Plus_2803
	picture = GFX_evt_bad_news
	
	is_triggered_only = yes
	
	option = { # Afri has forsaken me!
		name = EVTOPTA_Plus_2803
		scaled_wealth = -1.0
		prestige = -30
		piety = -10

		random = {
			chance = 60
			remove_trait = greedy
		}
	}
}

# Curious about parenthood
character_event = {
	id = Plus.2804
	desc = {
		trigger = {
			is_female = no
		}
		text = EVTDESCA_Plus_2804
	}
	desc = {
		trigger = {
			is_female = yes
		}
		text = EVTDESCB_Plus_2804
	}
	picture = GFX_evt_berber_pagan_child
	
	only_rulers = yes
	religion = berber_pagan
	min_age = 35
	capable_only = yes
	is_married = yes
	
	trigger = {
		OR = {
			AND = {
				is_female = yes
				NOT = { age = 44 }
			}
			AND = {
				is_female = no
				age = 50
			}
		}
		NOT = { 
			has_character_flag = blessing_of_fertility_sought
			num_of_children = 1
			trait = celibate
		}
	}

	mean_time_to_happen = {
		months = 3260
		
		modifier = {
			factor = 0.7
			trait = zealous
		}
		modifier = {
			factor = 0.5
			is_female = yes
		}
	}
	
	immediate = {
		set_character_flag = blessing_of_fertility_sought
	}
	
	option = { # I'll make an offering to Afri
		name = EVTOPTA_Plus_2804
		
		wealth = -20
		piety = 10
		
		random = {
			chance = 33
			
			fertility = 0.1
		}		
	}
	option = { # I'll pray to Afri
		name = EVTOPTB_Plus_2804
		
		piety = 5
		
		random = {
			chance = 10
			
			fertility = 0.1
		}
	}
	option = { # If it's meant to be, it will happen
		name = EVTOPTC_Plus_2804
		
		random = {
			chance = 20
			
			health = 0.1
		}
		random = {
			chance = 50
			
			add_trait = content
		}
	}
}