namespace = Plus

#reserved: Plus.3651 to Plus.3750

#######################################
# IMPERIAL GERMAN EVENTS
# Written by Zeress
#######################################

character_event = { # Clarify to player what this option does exactly
	id = Plus.3651
	desc = EVTDESC_Plus_3651
	picture = GFX_evt_council

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_3651 # Over time they will agree

		hidden_effect = {
			any_playable_ruler = {
				limit = { capital_scope = { region = world_europe } }
				narrative_event = { id = Plus.3653 }
			}
		}
	}
}

character_event = { # Attempt to convert vassals?
	id = Plus.3652
	desc = EVTDESC_Plus_3652
	picture = GFX_evt_council

	is_triggered_only = yes
	hide_from = yes

	option = {  # Attempt to impose Edict
		name = EVTOPTA_Plus_3652 # My will be so

		hidden_effect = {
			any_vassal = {
				limit = {
					higher_real_tier_than = BARON
					german_cultures_no_imperial_german_trigger = yes
				}
				letter_event = { id = Plus.3654 }
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_3652 # Perhaps not yet

		clr_character_flag = attempted_imp_german_conversion
	}
}

narrative_event = { # Imperial German has appeared
	id = Plus.3653
	title = EVTNAME_Plus_3653
	picture = GFX_evt_imperial_german_edict
	border = GFX_event_narrative_frame_diplomacy

	desc = {
		trigger = { is_vassal_or_below_of = FROM }
		text = EVTDESCA_Plus_3653
	}
	desc = {
		trigger = { NOT = { is_vassal_or_below_of = FROM } }
		text = EVTDESCB_Plus_3653
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = I_SEE
	}
}

letter_event = { # Kaisers attempts to convert vassal
	id = Plus.3654
	desc = EVTDESC_Plus_3654

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_3654 # I accept

		if = {
			limit = { owes_favor_to = FROM }
			remove_favor = FROM
		}

		culture = imperial_german

		hidden_effect = {
			any_courtier = {
				limit = {
					is_ruler = no
					prisoner = no
					german_cultures_no_imperial_german_trigger = yes
				}

				culture = imperial_german
			}
		}

		FROM = {
			letter_event = { id = Plus.3655 } # Inform of unchallenged acceptance
		}

		ai_chance = {
			factor = 10

			trigger = {
				opinion = {
					who = liege
					value >= -50
				}
			}

			mult_modifier = {
				factor = 10
				owes_favor_to = FROM
			}

			mult_modifier = {
				factor = 2

				opinion = {
					who = liege
					value >= 75
				}
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_3654 # I accept reluctantly

		culture = imperial_german

		any_child = {
			show_scope_change = no

			limit = {
				is_adult = no
				at_location = PREV
			}

			culture = imperial_german
		}

		FROM = {
			letter_event = { id = Plus.3656 } # Inform of reluctant acceptance
		}

		ai_chance = { factor = 10 }
	}

	option = {
		name = EVTOPTC_Plus_3654 # I accept in exchange for a favor

		trigger = {
			NOT = { holds_favor_on = FROM }
		}

		FROM = {
			letter_event = { id = Plus.3657 }
		}

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 1.5

				opinion = { who = liege value < 0 }
				opinion = { who = liege value >= -75 }
			}
		}
	}

	option = {
		name = EVTOPTD_Plus_3654 # I refuse

		ai_chance = {
			factor = 10

			trigger = {
				opinion = {
					who = liege
					value < 75
				}
			}

			mult_modifier = {
				factor = 2

				opinion = {
					who = liege
					value < -75
				}
			}
		}

		opinion = { # Angered by demand
			name = refused_imperial_edict_liege
			who = FROM
			years = 15
		}

		reverse_opinion = { # Liege angered by refusal
			name = refused_imperial_edict_vassal
			who = FROM
			years = 15
		}
	}
}

letter_event = { # Kaiser is informed of unchallenged acceptance
	id = Plus.3655
	desc = EVTDESC_Plus_3655

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3655 # Excellent
	}
}

letter_event = { # Kaiser is informed of reluctant acceptance
	id = Plus.3656
	desc = EVTDESC_Plus_3656

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3656 # Good
	}
}

letter_event = { # Kaiser is informed of acceptance in exchange for a favor
	id = Plus.3657
	desc = EVTDESC_Plus_3657

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_3657 # Fair Enough

		if = {
			limit = { holds_favor_on = FROM }
			remove_favor = FROM
		}
		else = {
			reverse_add_favor = FROM
		}

		FROM = {
			show_scope_change = no

			culture = imperial_german

			any_child = {
				limit = {
					is_adult = no
					at_location = PREV
				}

				culture = imperial_german
			}

			letter_event = { id = Plus.3658 } # Vassal is informed of usage or generation of a favor
		}
	}

	option = {
		name = EVTOPTB_Plus_3657 # Not even for a favor

		FROM = {
			show_scope_change = no

			opinion = { # Angered by demand
				name = refused_imperial_edict_liege
				who = PREV
				years = 15
			}

			reverse_opinion = { # Liege angered by refusal
				name = refused_imperial_edict_vassal
				who = PREV
				years = 15
			}

			letter_event = { id = Plus.3659 }
		}
	}
}

letter_event = { # Vassal is informed of usage or generation of a favor
	id = Plus.3658
	desc = EVTDESC_Plus_3658

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3657 # Fair Enough
	}
}

letter_event = { # Vassal is informed of refusal of a favor
	id = Plus.3659
	desc = EVTDESC_Plus_3659

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3659 # Problematic...

		tooltip = {
			opinion = { # Angered by demand
				name = refused_imperial_edict_liege
				who = FROM
				years = 15
			}

			reverse_opinion = { # Liege angered by refusal
				name = refused_imperial_edict_vassal
				who = FROM
				years = 15
			}
		}
	}
}

#######################################
# UNIFIED ITALIAN EVENTS
# Originally writtin by Zeress for the Imperial German event chain, adapted by Methaneus for the United Italian event chain
#######################################

character_event = { # Clarify to player what this option does exactly
	id = Plus.3660
	desc = EVTDESC_Plus_3660
	picture = GFX_evt_council

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_3651 # Over time they will agree

		hidden_effect = {
			any_playable_ruler = {
				limit = { capital_scope = { region = world_europe } }
				narrative_event = { id = Plus.3662 }
			}
		}
	}
}

character_event = { # Attempt to convert vassals?
	id = Plus.3661
	desc = EVTDESC_Plus_3652
	picture = GFX_evt_council

	is_triggered_only = yes
	hide_from = yes

	option = {  # Attempt to impose Edict
		name = EVTOPTA_Plus_3652 # My will be so

		hidden_effect = {
			any_vassal = {
				limit = {
					higher_real_tier_than = BARON
					is_italian_unification_enforcement_trigger = yes
				}

				letter_event = { id = Plus.3663 }
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_3652 # Perhaps not yet

		clr_character_flag = attempted_imp_german_conversion
	}
}

narrative_event = { # Unified Italian has appeared
	id = Plus.3662
	title = EVTNAME_Plus_3653
	picture = GFX_evt_imperial_german_edict
	border = GFX_event_narrative_frame_diplomacy

	desc = {
		trigger = { is_vassal_or_below_of = FROM }
		text = EVTDESCA_Plus_3660
	}
	desc = {
		trigger = { NOT = { is_vassal_or_below_of = FROM } }
		text = EVTDESCB_Plus_3660
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = I_SEE
	}
}

letter_event = { # Imperatores attempts to convert vassal
	id = Plus.3663
	desc = EVTDESC_Plus_3654

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_3654 # I accept

		if = {
			limit = { owes_favor_to = FROM }
			remove_favor = FROM
		}

		culture = italian

		hidden_effect = {
			any_courtier = {
				limit = {
					is_ruler = no
					prisoner = no
					is_italian_unification_enforcement_trigger = yes
				}

				culture = italian
			}
		}

		FROM = {
			letter_event = { id = Plus.3664 } # Inform of unchallenged acceptance
		}

		ai_chance = {
			factor = 10

			trigger = {
				opinion = {
					who = liege
					value >= -50
				}
			}

			mult_modifier = {
				factor = 10
				owes_favor_to = FROM
			}

			mult_modifier = {
				factor = 2

				opinion = {
					who = liege
					value >= 75
				}
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_3654 # I accept reluctantly

		culture = italian

		hidden_effect = {
			any_child = {
					limit = {
					is_adult = no
					at_location = PREV
				}

				culture = italian
			}
		}

		FROM = {
			letter_event = { id = Plus.3665 } # Inform of reluctant acceptance
		}

		ai_chance = { factor = 10 }
	}

	option = {
		name = EVTOPTC_Plus_3654 # I accept in exchange for a favor

		FROM = {
			letter_event = { id = Plus.3666 }
		}

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 1.5

				opinion = { who = liege value < 0 }
				opinion = { who = liege value >= -75 }
			}
		}
	}

	option = {
		name = EVTOPTD_Plus_3654 # I refuse

		opinion = { # Angered by demand
			name = refused_imperial_edict_liege
			who = FROM
			years = 15
		}

		reverse_opinion = { # Liege angered by refusal
			name = refused_imperial_edict_vassal
			who = FROM
			years = 15
		}

		ai_chance = {
			factor = 10

			trigger = {
				opinion = {
					who = liege
					value < 75
				}
			}

			mult_modifier = {
				factor = 2

				opinion = {
					who = liege
					value < -75
				}
			}
		}
	}
}

letter_event = { # Imperatore is informed of unchallenged acceptance
	id = Plus.3664
	desc = EVTDESC_Plus_3655

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3655 # Excellent
	}
}

letter_event = { # Imperatore is informed of reluctant acceptance
	id = Plus.3665
	desc = EVTDESC_Plus_3656

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3656 # Good
	}
}

letter_event = { # Imperatore is informed of acceptance in exchange for a favor
	id = Plus.3666
	desc = EVTDESC_Plus_3657

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3657 # Fair Enough

		if = {
			limit = { holds_favor_on = FROM }
			remove_favor = FROM
		}
		else = {
			reverse_add_favor = FROM
		}

		FROM = {
			show_scope_change = no

			culture = italian

			any_child = {
				show_scope_change = no

				limit = {
					is_adult = no
					at_location = PREV
				}

				culture = italian
			}

			letter_event = { id = Plus.3667 } # Vassal is informed of usage or generation of a favor
		}
	}

	option = {
		name = EVTOPTB_Plus_3657 # Not even for a favor

		FROM = {
			show_scope_change = no

			opinion = { # Angered by demand
				name = refused_imperial_edict_liege
				who = PREV
				years = 15
			}

			reverse_opinion = { # Liege angered by refusal
				name = refused_imperial_edict_vassal
				who = PREV
				years = 15
			}

			letter_event = { id = Plus.3668 }
		}
	}
}

letter_event = { # Vassal is informed of usage or generation of a favor
	id = Plus.3667
	desc = EVTDESC_Plus_3658

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3657 # Fair Enough
	}
}

letter_event = { # Vassal is informed of refusal of a favor
	id = Plus.3668
	desc = EVTDESC_Plus_3659

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_3659 # Problematic...

		tooltip = {
			opinion = { # Angered by demand
				name = refused_imperial_edict_liege
				who = FROM
				years = 15
			}

			reverse_opinion = { # Liege angered by refusal
				name = refused_imperial_edict_vassal
				who = FROM
				years = 15
			}
		}
	}
}