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

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	religion = berber_pagan
	min_age = 16
	only_capable = yes

	trigger = {
		NOT = { has_character_flag = berber_pagan_kilim }
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = zealous
		}

		mult_modifier = {
			factor = 0.5
			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

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	religion = berber_pagan
	min_age = 16
	only_capable = yes

	trigger = {
		scaled_wealth = 1
		NOT = { has_character_flag = blessing_of_afri_sought }
	}

	weight_multiplier = {
		factor = 1

		# Rare for non-greedy rulers
		mult_modifier = {
			factor = 2.5
			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_effect = {
			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_effect = {
			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_effect = yes
		}
	}
}

# 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_effect = yes
			remove_trait_charitable_effect = yes
		}
	}
}

# 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_effect = yes
		}
	}
}

# Curious about parenthood
character_event = {
	id = Plus.2804
	picture = GFX_evt_berber_pagan_child

	desc = {
		trigger = { is_female = no }
		text = EVTDESCA_Plus_2804
	}
	desc = {
		trigger = { is_female = yes }
		text = EVTDESCB_Plus_2804
	}

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	religion = berber_pagan
	is_married = yes
	min_age = 35
	only_capable = yes

	trigger = {
		has_children = no

		trigger_if = {
			limit = { is_female = yes }
			practical_age < 45
		}
		trigger_else = {
			age >= 50
		}

		NOR = {
			has_character_flag = blessing_of_fertility_sought
			trait = celibate
			trait = eunuch
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 1.43
			trait = zealous
		}

		mult_modifier = {
			factor = 2
			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_effect = yes
			remove_trait_ambitious_effect = yes
		}
	}
}