namespace = Plus
#reserved: Plus.2351 to Plus.2399

#######################################
# GERMANIC EVENTS
#######################################

### JOURNEY OF NERTHUS EVENTS

# Journey of Nerthus begins
narrative_event = {
	id = Plus.2351
	title = EVTNAME_Plus_2351
	desc = EVTDESC_Plus_2351
	picture = GFX_evt_nerthus
	border = GFX_event_narrative_frame_religion
	
	major = yes
	is_triggered_only = yes

	min_age = 16
	religion_group = pagan_group
	capable_only = yes
	prisoner = no
	has_character_flag = planning_journey_of_nerthus
	war = no
	
	trigger = {
		month = 3
		NOT = { month = 4 }
		OR = {
			religion = german_pagan
			religion = german_pagan_reformed
		}
		top_liege = {
			war = no
			NOT = { any_realm_lord = { war = yes } }
		}
		is_not_busy_trigger = yes
		NOT = { is_inaccessible_trigger = yes }
	}
	
	major_trigger = {
		same_realm = ROOT
	}

	immediate = {
		clr_character_flag = planning_journey_of_nerthus
		top_liege = {
			save_event_target_as = nerthus_top_liege
			primary_title = { set_title_flag = recent_journey_of_nerthus }
		}
	}
	
	option = {
		name = EVTOPTA_Plus_2351 #Hold the feast!
		trigger = {
			character = event_target:nerthus_top_liege
			NOT = { has_character_flag = planning_feast }
			scaled_wealth = 0.5
		}
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0
				has_character_modifier = ai_austerity
			}
			modifier = {
				factor = 0.25
				piety = 50
				OR = {
					trait = shy
					trait = greedy
					trait = paranoid
					trait = cynical
				}
			}
		}
		piety = 100
		add_character_modifier = {
			name = holding_large_feast
			duration = -1
		}
		set_character_flag = nerthus_feast
		set_character_flag = held_recent_feast
		clr_character_flag = sent_invitations
		clr_character_flag = host_feast_started
		clr_character_flag = feast_jongleur
		clr_character_flag = feast_musicians
		clr_character_flag = dealt_with_robber_band
		clr_character_flag = guest_daughter_event
		clr_character_flag = guest_claim_event
		clr_character_flag = feast_minstrel
		clr_character_flag = feast_fireeaters
		clr_character_flag = feast_conjurer
		clr_character_flag = lavishly_food
		clr_character_flag = medium_food
		clr_character_flag = low_food
		clr_character_flag = castle_problems
		clr_character_flag = feast_jester 
		clr_character_flag = feast_drunkard_guest
		clr_character_flag = feast_duel
		clr_character_flag = feast_boar_hunt
		hidden_tooltip = {
			character_event = { id = 72003 days = 25 random = 10 } # food preparations
			character_event = { id = 72997 days = 7 random = 5 } # first pre-feast event trigger
			character_event = { id = 72999 days = 300 }	# Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 85
				hidden = yes
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_2351 #I was already planning a feast!
		trigger = {
			character = event_target:nerthus_top_liege
			has_character_flag = planning_feast
		}
		piety = 100
		set_character_flag = nerthus_feast
		set_character_flag = held_recent_feast
		clr_character_flag = planning_feast
		clr_character_flag = sent_invitations
		clr_character_flag = host_feast_started
		clr_character_flag = feast_jongleur
		clr_character_flag = feast_musicians
		clr_character_flag = dealt_with_robber_band
		clr_character_flag = guest_daughter_event
		clr_character_flag = guest_claim_event
		clr_character_flag = feast_minstrel
		clr_character_flag = feast_fireeaters
		clr_character_flag = feast_conjurer
		clr_character_flag = lavishly_food
		clr_character_flag = medium_food
		clr_character_flag = low_food
		clr_character_flag = castle_problems
		clr_character_flag = feast_jester 
		clr_character_flag = feast_drunkard_guest
		clr_character_flag = feast_duel
		clr_character_flag = feast_boar_hunt
		hidden_tooltip = {
			character_event = { id = 72003 days = 25 random = 10 } # food preparations
			character_event = { id = 72997 days = 7 random = 5 } # first pre-feast event trigger
			character_event = { id = 72999 days = 300 }	# Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 85
				hidden = yes
			}
		}
	}
	option = {
		name = EVTOPTC_Plus_2351 #Do not hold the feast
		trigger = {
			character = event_target:nerthus_top_liege
			NOT = { has_character_flag = planning_feast }
			scaled_wealth = 0.5
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 3
				OR = {
					trait = stressed
					trait = depressed
					is_ill = yes
				}
			}
		}
		piety = -50
		prestige = -50
	}
	option = {
		name = EVTOPTD_Plus_2351 #Alas, I cannot afford it
		trigger = {
			character = event_target:nerthus_top_liege
			NOT = { has_character_flag = planning_feast }
			NOT = { scaled_wealth = 0.5 }
		}
		prestige = -100
	}
	option = {
		name = EVTOPTE_Plus_2351 #This shall be a joyous time
		trigger = {
			NOT = { character = event_target:nerthus_top_liege }
			is_pagan_religion = yes
		}
	}
	option = {
		name = EVTOPTF_Plus_2351 #Paying homage to a pagan goddess?
		trigger = {
			NOT = { character = event_target:nerthus_top_liege }
			is_pagan_religion = no
		}
	}
}

# Journey of Nerthus ends
narrative_event = {
	id = Plus.2352
	title = EVTNAME_Plus_2351
	desc = EVTDESC_Plus_2352
	picture = GFX_evt_nerthus
	border = GFX_event_narrative_frame_religion
	
	major = yes
	is_triggered_only = yes
	
	religion_group = pagan_group

	trigger = {
		OR = {
			religion = german_pagan
			religion = german_pagan_reformed
		}
	}

	major_trigger = {
		same_realm = ROOT
	}
	
	immediate = {
		if = {
			limit = { has_landed_title = d_german_pagan_reformed }
			character_event = { id = Plus.2353 days = 1 }
			break = yes
		}
		random_realm_lord = {
			limit = { has_landed_title = d_german_pagan_reformed }
			character_event = { id = Plus.2353 days = 1 }
			break = yes
		}
		job_spiritual = {
			character_event = { id = Plus.2353 days = 1 }
			break = yes
		}
	}
	
	option = {
		name = EVTOPTA_Plus_2352
		trigger = {
			OR = {
				religion = german_pagan
				religion = german_pagan_reformed
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_2352
		trigger = {
			NOR = {
				religion = german_pagan
				religion = german_pagan_reformed
			}
		}
	}
}
	
# Nerthus cart purified
character_event = {
	id = Plus.2353
	title = EVTNAME_Plus_2351
	desc = EVTDESC_Plus_2353
	picture = GFX_evt_nerthus
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	religion_group = pagan_group
	
	trigger = {
		OR = {
			religion = german_pagan
			religion = german_pagan_reformed
		}
		OR = {
			has_job_title = job_spiritual
			has_landed_title = d_german_pagan_reformed
		}
	}
	
	option = {
		name = EVTOPTA_Plus_2353
	}
}
	
# Childless woman hears of Nerthus's Journey
character_event = {
	id = Plus.2354
	desc = EVTDESC_Plus_2354
	picture = GFX_evt_nerthus
	border = GFX_event_normal_frame_religion
	
	min_age = 16
	max_age = 45
	only_women = yes
	prisoner = no
	capable_only = yes
	
	trigger = {
		OR = {
			religion = german_pagan
			religion = german_pagan_reformed
			NOT = { trait = zealous }
		}
		top_liege = { has_character_flag = nerthus_feast }
		OR = {
			is_married = yes
			is_consort = yes
		}
		NOR = {
			num_of_children = 1
			is_inaccessible_trigger = yes
			trait = celibate
			has_character_flag = nerthus_fertility
		}
	}
	
	mean_time_to_happen = {
		days = 10
		modifier = {
			factor = 0.1
			has_character_flag = knows_barren
		}
		modifier = {
			factor = 0.5
			OR = {
				trait = infertile
				has_character_modifier = barren
			}
		}
		modifier = {
			factor = 2
			NOT = { age = 20 }
		}
		modifier = {
			factor = 2
			NOT = { age = 25 }
		}
		modifier = {
			factor = 0.5
			age = 30
		}
		modifier = {
			factor = 0.5
			spouse = { is_lover = ROOT }
		}
		modifier = {
			factor = 0.5
			is_smart_trigger = yes
		}
		modifier = {
			factor = 2
			is_dumb_trigger = yes
		}
	}

	option = {
		name = EVTOPTA_Plus_2354 #Maybe Nerthus can help with my...problem
		set_character_flag = nerthus_fertility
		if = {
			limit = {
				NOR = {
					religion = german_pagan
					religion = german_pagan_reformed
				}
			}
			piety = -25
		}
		if = {
			limit = {
				is_pagan_religion = no
				NOT = { trait = sympathy_pagans }
			}
			add_trait = sympathy_pagans
		}
		random_list = {
			40 = {}
			10 = {
				modifier = {
					factor = 0
					NOR = {
						has_character_modifier = barren
						trait = infertile
					}
				}
				modifier = {
					factor = 3
					has_character_modifier = infertile
				}
				custom_tooltip = {
					text = REMOVE_BARREN_SUCCESS
					remove_trait = infertile
					hidden_tooltip = {
						clr_character_flag = is_barren
						remove_character_modifier = barren
					}
				}
			}
			40 = {
				modifier = {
					factor = 0
					NOT = { has_character_modifier = barren }
				}
				custom_tooltip = {
					text = REMOVE_BARREN_BUT_INFERTILE
					hidden_tooltip = {
						clr_character_flag = is_barren
						remove_character_modifier = barren
						add_trait = infertile
					}
				}
			}
			40 = {
				modifier = {
					factor = 0
					OR = {
						has_character_modifier = barren
						trait = infertile
					}
				}
				add_character_modifier = {
					name = precious_item
					duration = 730
				}
			}
			13 = {
				modifier = {
					factor = 0
					OR = {
						trait = wounded
						is_maimed_trigger = yes
					}
				}
				add_trait = wounded
				hidden_tooltip = {
					character_event = { id = 38280 days = 1 }
				}
			}
			5 = {
				modifier = {
					factor = 0
					OR = {
						trait = wounded
						is_maimed_trigger = yes
					}
				}
				add_maimed_trait_effect = yes
				hidden_tooltip = {
					character_event = { id = 38281 days = 1 }
				}
			}
			2 = {
				death = { death_reason = death_accident }
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_2354 #There is nothing wrong with me!
		set_character_flag = nerthus_fertility
	}
}

### REBUILDING IRMINSUL

# Irminsul Reborn
narrative_event = {
	id = Plus.2356
	title = EVTNAME_Plus_2356
	desc = EVTDESC_Plus_2356
	picture = GFX_evt_irminsul_shrine
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	only_independent = yes
	only_rulers = yes
	
	trigger = {
		has_global_flag = irminsul
		OR = {
			religion = german_pagan
			religion = german_pagan_reformed
			religion = norse_pagan
			religion = norse_pagan_reformed
		}
		NOT = { has_global_flag = irminsul_reborn }
		any_realm_province = {
			province_id = 257
			any_province_holding = { has_building = tp_holy_site_irminsul }
		}
	}
	
	immediate = {
		set_global_flag = irminsul_reborn
	}
	
	option = {
		name = EVTOPTA_Plus_2356
		religion_authority = {
			modifier = irminsul_reborn
		}
	}
}

