namespace = PlusFaction

#reserved: PlusFaction.300 to PlusFaction.399

##################################
# FACTION MEETING EVENTS
# Original Faction System by Wiz
# Re-Written by Rylock
##################################

# Calling the faction meeting -- under normal circumstances, this should come up about once
# every three years (two if the faction is angry). A player can start a meeting via decision.
character_event = {
	id = PlusFaction.300
	picture = GFX_evt_emissary

	desc = {
		text = EVTDESC_PlusFaction_300_COURT
		trigger = { leads_faction = faction_court }
	}
	desc = {
		text = EVTDESC_PlusFaction_300_PROSPERITY
		trigger = { leads_faction = faction_prosperity }
	}
	desc = {
		text = EVTDESC_PlusFaction_300_GLORY
		trigger = { leads_faction = faction_glory }
	}
	desc = {
		text = EVTDESC_PlusFaction_300_TRADITION
		trigger = { leads_faction = faction_tradition }
	}

	only_playable = yes
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no

		# There is no pending civil war
		pf_pending_civil_war_trigger = no

		trigger_if = {
			# If the meeting was postponed
			limit = { has_character_flag = faction_meeting_postponed }

			OR = {
				# It's been two years since the meeting was postponed
				had_character_flag = {
					flag = faction_meeting_postponed
					years >= 2
				}

				# It's been a year since the meeting was postponed and the faction is angry
				AND = {
					pf_my_faction_angry_trigger = yes
					liege = { is_primary_war_defender = no }

					had_character_flag = {
						flag = faction_meeting_postponed
						years >= 1
					}
				}
			}
		}

		trigger_if = {
			# If already held a meeting
			limit = { has_character_flag = faction_meeting }

			OR = {
				# It's been three years since the last meeting
				had_character_flag = {
					flag = faction_meeting
					years >= 3
				}

				# It's been two years since the last meeting and the faction is angry
				AND = {
					had_character_flag = {
						flag = faction_meeting
						years >= 2
					}

					pf_my_faction_angry_trigger = yes

					liege = {
						NOR = {
							any_war = {
								defender = { character = PREVPREV }
							}
						}
					}
				}
			}
		}

		# There's more than one faction member other than the leader
		liege = { any_vassal = { pf_root_faction_backer_trigger = yes } }

		total_years_played >= 2

		NOR = {
			has_character_flag = faction_meeting_called
			has_character_flag = faction_leadership_challenge
		}
	}

	mean_time_to_happen = {
		years = 1

		mult_modifier = {
			factor = 0.05

			OR = {
				has_character_flag = faction_meeting_postponed

				had_character_flag = {
					flag = faction_meeting
					years >= 5
				}
			}
		}

		mult_modifier = {
			factor = 5
			liege = { is_primary_war_defender = yes }
		}

		mult_modifier = {
			factor = 0.1

			pf_my_faction_angry_trigger = yes
			liege = { is_primary_war_defender = no }
		}
	}

	option = {
		name = EVTOPTA_PlusFaction_300 # Send out the invitations

		# Reset the voting and delay variables
		hidden_effect = {
			set_variable = { which = faction_votes value = 0 }
			set_variable = { which = faction_meeting_delay value = 0 }
		}

		set_character_flag = faction_meeting_called

		trigger_switch = {
			on_trigger = leads_faction

			faction_court = { custom_tooltip = { text = CUSTOMTOOLTIP51 } }
			faction_prosperity = { custom_tooltip = { text = CUSTOMTOOLTIP52 } }
			faction_glory = { custom_tooltip = { text = CUSTOMTOOLTIP53 } }
			faction_tradition = { custom_tooltip = { text = CUSTOMTOOLTIP54 } }
		}

		# Send the invitations -- note that three events are fired, since only one of them can ultimately be true
		# Just in case the meeting can't actually be held or there's a leadership challenge from one of the invitees
		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.302 }
				}
			}

			character_event = { id = PlusFaction.303 days = 15 } # Meeting postponed
			character_event = { id = PlusFaction.304 days = 15 } # Start the meeting
			character_event = { id = PlusFaction.350 days = 15 } # Leadership challenged
		}

		# Take the character out of hiding
		end_inaccessibility_effect = yes

		ai_chance = { factor = 90 }
	}

	option = {
		name = EVTOPTB_PlusFaction_300 # It can wait

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 100
				war = yes
			}

			mult_modifier = {
				factor = 100
				is_inaccessible_trigger = yes
			}

			mult_modifier = {
				factor = 0.1

				check_variable = {
					which = faction_meeting_delay
					value >= 1
				}
			}

			mult_modifier = {
				factor = 0.1

				check_variable = {
					which = faction_meeting_delay
					value >= 2
				}
			}

			mult_modifier = {
				factor = 0.1

				check_variable = {
					which = faction_meeting_delay
					value >= 3
				}
			}

			mult_modifier = {
				factor = 0.1

				check_variable = {
					which = faction_meeting_delay
					value >= 4
				}
			}
		}

		set_character_flag = faction_meeting_postponed
		custom_tooltip = { text = CUSTOMTOOLTIP50 }

		# There is a chance the leader will be auto-removed as faction leader
		# based on how many consecutive delays there have been
		random_list = {
			33 = {
				trigger = {
					check_variable = {
						which = faction_meeting_delay
						value >= 1
					}
				}

				character_event = {
					id = PlusFaction.301
					tooltip = CUSTOMTOOLTIP45
				}

				additive_modifier = {
					value = 17 # 50%

					check_variable = {
						which = faction_meeting_delay
						value >= 2
					}
				}

				additive_modifier = {
					value = 25 # 75%

					check_variable = {
						which = faction_meeting_delay
						value >= 3
					}
				}

				additive_modifier = {
					value = 25 # 100%

					check_variable = {
						which = faction_meeting_delay
						value >= 4
					}
				}
			}
		}

		hidden_effect = {
			change_variable = {
				which = faction_meeting_delay
				value = 1
			}
		}
	}
}

# Faction leader replaced due to postponing the meeting for too long
character_event = {
	id = PlusFaction.301
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_301

	is_triggered_only = yes
	hide_from = yes

	immediate = {
		liege = {
			any_vassal = {
				limit = { pf_root_faction_backer_trigger = yes }
				character_event = { id = PlusFaction.307 } # Notify
			}
		}

		set_character_flag = former_faction_leader
		set_character_flag = removed_from_leadership
	}

	option = {
		name = CURSES

		custom_tooltip = { text = CUSTOMTOOLTIP45 }

		trigger_switch = {
			on_trigger = real_tier

			BARON = { prestige = -50 }
			COUNT = { prestige = -100 }
			DUKE = { prestige = -200 }
			KING = { prestige = -400 }
		}
	}
}

# Faction member receives the invitation to the meeting
# and decides whether to call for a vote of no confidence
character_event = {
	id = PlusFaction.302
	desc = EVTDESC_PlusFaction_302
	picture = GFX_evt_council

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_302 # Let's get on with the meeting

		ai_chance = {
			factor = 50

			mult_modifier = {
				factor = 0.75
				FROM = { diplomacy < 8 }
			}

			mult_modifier = {
				factor = 0.75
				FROM = { diplomacy < 4 }
			}

			mult_modifier = {
				factor = 1.25
				trait = diligent
			}

			mult_modifier = {
				factor = 1.25
				trait = wroth
			}

			mult_modifier = {
				factor = 1.25
				trait = cruel
			}

			mult_modifier = {
				factor = 1.5
				trait = proud
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_302 # I intend to call a vote of no confidence

		trigger = { is_playable = yes }

		ai_chance = {
			factor = 50

			trigger = {
				opinion = {
					who = FROM
					value < 0
				}
			}

			mult_modifier = {
				factor = 0.5

				opinion = {
					who = FROM
					value >= -25
				}
			}

			mult_modifier = {
				factor = 0.75
				FROM = { diplomacy >= 12 }
			}

			mult_modifier = {
				factor = 0.75
				FROM = { diplomacy >= 14 }
			}

			mult_modifier = {
				factor = 0.75
				FROM = { diplomacy >= 16 }
			}

			mult_modifier = {
				factor = 0.75
				FROM = { diplomacy >= 18 }
			}

			mult_modifier = {
				factor = 0.75
				FROM = { diplomacy >= 20 }
			}

			mult_modifier = {
				factor = 1.5
				higher_real_tier_than = FROM
			}

			mult_modifier = {
				factor = 2.0

				has_opinion_modifier = {
					name = upset_faction_decision
					who = FROM
				}
			}

			mult_modifier = {
				factor = 0.5

				NOT = {
					has_opinion_modifier = {
						name = upset_faction_decision
						who = FROM
					}
				}
			}

			mult_modifier = {
				factor = 0.75
				trait = slothful
			}

			mult_modifier = {
				factor = 0.75
				trait = patient
			}

			mult_modifier = {
				factor = 0.75
				trait = shy
			}

			mult_modifier = {
				factor = 0.5
				trait = humble
			}

			mult_modifier = {
				factor = 0.5
				trait = content
			}

			mult_modifier = {
				factor = 2

				OR = {
					trait = lunatic
					trait = possessed
				}
			}
		}

		FROM = {
			clr_character_flag = faction_meeting_called
			set_character_flag = faction_leadership_challenge
		}
	}
}

# The meeting must be postponed
character_event = {
	id = PlusFaction.303
	desc = EVTDESC_PlusFaction_303
	picture = GFX_evt_council

	hide_from = yes
	is_triggered_only = yes

	trigger = {
		OR = {
			pf_war_trait_trigger = yes
			pf_leader_trigger = no

			# They don't have a second faction member any longer
			liege = {
				NOT = {
					any_vassal = {
						pf_root_faction_backer_trigger = yes
					}
				}
			}
		}
	}

	option = {
		name = {
			text = EVTOPTA_PlusFaction_303A
			trigger = { pf_leader_trigger = no }
		}
		name = {
			text = EVTOPTA_PlusFaction_303B
			trigger = {
				pf_leader_trigger = yes
				pf_war_trait_trigger = yes
			}
		}
		name = {
			text = EVTOPTA_PlusFaction_303C
			trigger = {
				pf_leader_trigger = yes
				pf_war_trait_trigger = no
			}
		}

		clr_character_flag = faction_meeting_called
		clr_character_flag = faction_leadership_challenge
		set_character_flag = faction_meeting_postponed

		custom_tooltip = {
			text = CUSTOMTOOLTIP50

			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					letter_event = { id = PlusFaction.308 } # Notify
				}
			}
		}
	}
}

# Setting the agenda for the meeting
character_event = {
	id = PlusFaction.304
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_304_Happy
		trigger = { has_character_flag = faction_is_happy }
	}
	desc = {
		text = EVTDESC_PlusFaction_304_Unhappy
		trigger = { has_character_flag = faction_is_unhappy }
	}
	desc = {
		text = EVTDESC_PlusFaction_304_Angry
		trigger = { has_character_flag = faction_is_angry }
	}
	desc = {
		text = EVTDESC_PlusFaction_304_Content
		trigger = { has_character_flag = faction_is_content }
	}

	is_triggered_only = yes
	hide_from = yes

	has_character_flag = faction_meeting_called

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no

		liege = {
			any_vassal = {
				pf_root_faction_backer_trigger = yes
			}
		}
	}

	immediate = {
		# Clear all the demand flags
		set_character_flag = faction_meeting_begun
		pf_clear_demands_flags_effect = yes

		# Check to see if there are any demands which are valid to make for the faction
		if = {
			limit = {
				trigger_if = {
					limit = { leads_faction = faction_court }

					liege = {
						trigger_if = {
							limit = { independent = no }

							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}

						OR = {
							trigger_if = {
								limit = { is_tribal = yes }

								independent = yes

								OR = {
									has_law = tribal_organization_1
									has_law = tribal_organization_2
									has_law = tribal_organization_3
									has_law = tribal_organization_4
								}
							}
							trigger_else = {
								any_demesne_title = {
									is_crown_law_title = yes

									OR = {
										has_law = crown_authority_1
										has_law = crown_authority_2
										has_law = crown_authority_3
										has_law = crown_authority_4
									}
								}
							}

							any_demesne_title = {
								real_tier = COUNT
								can_be_given_away = yes
								is_feudal = yes
								location = { is_capital = no }
							}

							OR = {
								has_law = feudal_obligations_1
								has_law = feudal_obligations_2
								has_law = feudal_obligations_3
								has_law = feudal_obligations_4
								has_law = iqta_obligations_1
								has_law = iqta_obligations_2
								has_law = iqta_obligations_3
								has_law = iqta_obligations_4

								trigger_if = {
									limit = { ROOT = { is_tribal = yes } }

									OR = {
										has_law = tribal_obligations_1
										has_law = tribal_obligations_2
										has_law = tribal_obligations_3
										has_law = tribal_obligations_4
									}
								}
							}
						}
					}
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }

					liege = {
						trigger_if = {
							limit = { independent = no }

							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}

						OR = {
							trigger_if = {
								limit = { wealth >= 100 }

								NOR = {
									has_character_flag = loan_taken
									has_character_modifier = ai_austerity
								}
							}

							any_demesne_title = {
								real_tier = COUNT
								can_be_given_away = yes
								is_feudal = yes
								location = { is_capital = no }
							}

							OR = {
								has_law = city_obligations_1
								has_law = city_obligations_2
								has_law = city_obligations_3
								has_law = city_obligations_4
								has_law = feudal_obligations_4
								has_law = iqta_obligations_4

								trigger_if = {
									limit = { ROOT = { is_tribal = yes } }
									has_law = tribal_obligations_4
								}
							}
						}
					}
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }

					liege = {
						trigger_if = {
							limit = { independent = no }

							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}

						OR = {
							trigger_if = {
								limit = { is_tribal = yes }

								independent = yes

								OR = {
									has_law = tribal_organization_1
									has_law = tribal_organization_2
									has_law = tribal_organization_3
									has_law = tribal_organization_4
								}
							}

							trigger_else = {
								any_demesne_title = {
									is_crown_law_title = yes

									OR = {
										has_law = crown_authority_1
										has_law = crown_authority_2
										has_law = crown_authority_3
										has_law = crown_authority_4
									}
								}
							}

							any_demesne_title = {
								real_tier = COUNT
								can_be_given_away = yes
								is_feudal = yes
								location = { is_capital = no }
							}

							OR = {
								has_law = feudal_obligations_3
								has_law = feudal_obligations_4
								has_law = iqta_obligations_3
								has_law = iqta_obligations_4

								trigger_if = {
									limit = { ROOT = { is_tribal = yes } }

									OR = {
										has_law = tribal_obligations_3
										has_law = tribal_obligations_4
									}
								}
							}
						}
					}
				}
				trigger_else_if = {
					limit = { leads_faction = faction_tradition }

					liege = {
						trigger_if = {
							limit = { independent = no }

							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}

						OR = {
							trigger_if = {
								limit = { is_tribal = yes }

								independent = yes

								OR = {
									has_law = tribal_organization_1
									has_law = tribal_organization_2
									has_law = tribal_organization_3
									has_law = tribal_organization_4
								}
							}
							trigger_else = {
								any_demesne_title = {
									is_crown_law_title = yes

									OR = {
										has_law = crown_authority_1
										has_law = crown_authority_2
										has_law = crown_authority_3
										has_law = crown_authority_4
									}
								}
							}

							any_demesne_title = {
								real_tier = COUNT
								can_be_given_away = yes
								is_feudal = yes
								location = { is_capital = no }
							}

							primary_title = {
								OR = {
									has_law = temple_obligations_1
									has_law = temple_obligations_2
									has_law = temple_obligations_3
									has_law = temple_obligations_4
									has_law = council_privileges_0
									has_title_flag = former_gavelkind
									has_title_flag = former_seniority
									has_title_flag = former_primogeniture
									has_title_flag = former_feudal_elective
									has_title_flag = former_hre_elective
									has_title_flag = former_byzantine_elective
									has_title_flag = former_tanistry
									has_title_flag = former_eldership
									has_title_flag = former_ultimogeniture
									has_title_flag = former_agnatic_succession
									has_title_flag = former_cognatic_succession
									has_title_flag = former_true_cognatic_succession
									has_title_flag = former_enatic_cognatic_succession
									has_title_flag = former_enatic_succession
								}
							}
						}
					}
				}
			}

			set_character_flag = can_make_demand

			# Pick a county of the liege's which could be given away and also choose
			# which faction member it should be given to
			liege = {
				random_demesne_title = {
					limit = {
						can_be_given_away = yes
						real_tier = COUNT
						is_feudal = yes
						location = { is_capital = no }
					}

					# First pick a faction member with a strong claim to the title
					preferred_limit = {
						any_claimant = {
							has_strong_claim = PREV

							OR = {
								pf_root_faction_backer_trigger = yes
								character = ROOT
							}
						}
					}

					# Then pick a faction member with any claim to the title
					preferred_limit = {
						any_claimant = {
							OR = {
								pf_root_faction_backer_trigger = yes
								character = ROOT
							}
						}
					}

					# Then pick a de jure liege
					preferred_limit = {
						any_de_jure_liege_title = {
							holder_scope = {
								OR = {
									pf_root_faction_backer_trigger = yes
									character = ROOT
								}
							}
						}
					}

					# Then pick anyone with a neighboring province
					preferred_limit = {
						location = {
							any_neighbor_province = {
								owner = {
									OR = {
										pf_root_faction_backer_trigger = yes
										character = ROOT
									}
								}
							}
						}
					}

					save_event_target_as = faction_demanded_title
				}

				random_vassal = {
					limit = {
						OR = {
							pf_root_faction_backer_trigger = yes
							character = ROOT
						}
					}

					# Same priorities as above
					preferred_limit = { has_strong_claim = event_target:faction_demanded_title }
					preferred_limit = { has_claim = event_target:faction_demanded_title }
					preferred_limit = { event_target:faction_demanded_title = { has_de_jure_pretension = PREV } }
					preferred_limit = {
						any_demesne_province = {
							owned_by = PREV

							any_neighbor_province = {
								county = {
									title = event_target:faction_demanded_title
								}
							}
						}
					}

					save_event_target_as = faction_demanded_title_for
				}
			}
		}

		# Now set the leader's faction mood
		trigger_switch = {
			on_trigger = leads_faction

			faction_court = {
				liege = {
					trigger_switch = {
						on_trigger = has_character_flag

						faction_court_happy = { ROOT = { set_character_flag = faction_is_happy } }
						faction_court_unhappy = { ROOT = { set_character_flag = faction_is_unhappy } }
						faction_court_angry = { ROOT = { set_character_flag = faction_is_angry } }
						fallback = { ROOT = { set_character_flag = faction_is_content } }
					}
				}
			}

			faction_prosperity = {
				liege = {
					trigger_switch = {
						on_trigger = has_character_flag

						faction_prosperity_happy = { ROOT = { set_character_flag = faction_is_happy } }
						faction_prosperity_unhappy = { ROOT = { set_character_flag = faction_is_unhappy } }
						faction_prosperity_angry = { ROOT = { set_character_flag = faction_is_angry } }
						fallback = { ROOT = { set_character_flag = faction_is_content } }
					}
				}
			}

			faction_glory = {
				liege = {
					trigger_switch = {
						on_trigger = has_character_flag

						faction_glory_happy = { ROOT = { set_character_flag = faction_is_happy } }
						faction_glory_unhappy = { ROOT = { set_character_flag = faction_is_unhappy } }
						faction_glory_angry = { ROOT = { set_character_flag = faction_is_angry } }
						fallback = { ROOT = { set_character_flag = faction_is_content } }
					}
				}
			}

			faction_tradition = {
				liege = {
					trigger_switch = {
						on_trigger = has_character_flag

						faction_tradition_happy = { ROOT = { set_character_flag = faction_is_happy } }
						faction_tradition_unhappy = { ROOT = { set_character_flag = faction_is_unhappy } }
						faction_tradition_angry = { ROOT = { set_character_flag = faction_is_angry } }
						fallback = { ROOT = { set_character_flag = faction_is_content } }
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTA_PlusFaction_304 # I will strengthen my position within the faction

		trigger = {
			NOT = { has_character_flag = faction_is_angry }
		}

		character_event = {
			id = PlusFaction.310
			tooltip = EVTTOOLTIP1900600
		}

		ai_chance = {
			factor = 100

			trigger = {
				liege = {
					any_vassal = {
						pf_root_faction_backer_trigger = yes

						opinion = {
							who = ROOT
							value < 0
						}
					}
				}
			}

			mult_modifier = {
				factor = 0.25
				has_character_flag = faction_is_unhappy
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 1.25
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = envious
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.75
				trait = humble
			}

			mult_modifier = {
				factor = 0.75
				trait = content
			}

			mult_modifier = {
				factor = 0.75
				trait = charitable
			}

			mult_modifier = {
				factor = 0.5

				liege = {
					NOT = {
						any_vassal = {
							pf_root_faction_backer_trigger = yes

							opinion = {
								who = ROOT
								value < -25
							}
						}
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_304 # I plan to rally support for my liege

		trigger = {
			OR = {
				has_character_flag = faction_is_happy
				has_character_flag = faction_is_content
			}
		}

		character_event = {
			id = PlusFaction.313 # Strengthen liege
			tooltip = EVTTOOLTIP1900601
		}

		ai_chance = {
			factor = 100

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

			mult_modifier = {
				factor = 0.5

				OR = {
					trait = stutter
					diplomacy < 8
				}
			}

			mult_modifier = {
				factor = 1.25
				trait = kind
			}

			mult_modifier = {
				factor = 1.25
				trait = humble
			}

			mult_modifier = {
				factor = 1.25
				trait = content
			}

			mult_modifier = {
				factor = 0.75
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.75
				trait = proud
			}

			mult_modifier = {
				factor = 0.75
				trait = envious
			}

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 0.5

				opinion = {
					who = liege
					value < 0
				}
			}

			mult_modifier = {
				factor = 0.25

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

	option = {
		name = EVTOPTC_PlusFaction_304 # I will stir discontent towards my liege

		trigger = {
			OR = {
				has_character_flag = faction_is_happy
				has_character_flag = faction_is_content
			}
		}

		character_event = {
			id = PlusFaction.317 # Weaken liege
			tooltip = EVTTOOLTIP1900602
		}

		ai_chance = {
			factor = 110

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

			mult_modifier = {
				factor = 0.75
				trait = kind
			}

			mult_modifier = {
				factor = 0.75
				trait = humble
			}

			mult_modifier = {
				factor = 0.75
				trait = content
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 1.25
				trait = envious
			}

			mult_modifier = {
				factor = 0.25

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

			mult_modifier = {
				factor = 0.5

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

			mult_modifier = {
				factor = 1.25

				opinion = {
					who = liege
					value < 0
				}
			}

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 2.0

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

			mult_modifier = {
				factor = 2.0

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

			mult_modifier = {
				factor = 0.5

				has_game_rule = {
					name = factions_aggression
					value = reduced
				}
			}

			mult_modifier = {
				factor = 1.5

				has_game_rule = {
					name = factions_aggression
					value = high
				}
			}

			mult_modifier = {
				factor = 2.0

				has_game_rule = {
					name = factions_aggression
					value = very_high
				}
			}
		}
	}

	option = {
		name = EVTOPTD_PlusFaction_304 # Pass the time

		trigger = {
			OR = {
				has_character_flag = faction_is_happy
				has_character_flag = faction_is_content
			}
		}

		character_event = {
			id = PlusFaction.399 # Clear flags
			days = 1
			tooltip = CUSTOMTOOLTIP56
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.306 }
				}
			}
		}

		ai_chance = {
			factor = 25

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_happy
			}

			mult_modifier = {
				factor = 5
				trait = slothful
			}

			mult_modifier = {
				factor = 0.1

				OR = {
					trait = ambitious
					trait = diligent
				}
			}
		}
	}

	option = {
		name = EVTOPTE_PlusFaction_304 # Our liege must step down

		trigger = {
			has_character_flag = faction_is_angry

			trigger_if = {
				limit = { has_character_flag = can_make_demand }

				has_opinion_modifier = {
					name = ultimatum_refused
					who = liege
				}
			}

			liege = {
				trigger_if = {
					limit = { independent = no }

					will_liege_enforce_peace = no
					has_liege_enforced_peace = no
				}
			}
		}

		character_event = {
			id = PlusFaction.344
			days = 7
			tooltip = EVTTOOLTIP1900737
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.343 } # Vote
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { change_variable = { which = faction_votes value = 1 } }
				COUNT = { change_variable = { which = faction_votes value = 2 } }
				DUKE = { change_variable = { which = faction_votes value = 4 } }
				KING = { change_variable = { which = faction_votes value = 8 } }
			}
		}

		ai_chance = {
			factor = 110

			trigger = {
				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 0.75 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 0.75 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 0.75 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_tradition }
					faction_power = { faction = faction_tradition power >= 0.75 }
				}
			}

			mult_modifier = {
				factor = 1.5

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
			}

			mult_modifier = {
				factor = 3.0

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
			}

			mult_modifier = {
				factor = 5.0

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 3 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 3 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 3 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 3 }
				}
			}

			mult_modifier = {
				factor = 0.01
				liege = { is_primary_war_defender = yes }
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 0.5
				trait = craven
			}

			mult_modifier = {
				factor = 0.5

				has_game_rule = {
					name = factions_aggression
					value = reduced
				}
			}

			mult_modifier = {
				factor = 1.5

				has_game_rule = {
					name = factions_aggression
					value = high
				}
			}

			mult_modifier = {
				factor = 2.0

				has_game_rule = {
					name = factions_aggression
					value = very_high
				}
			}
		}
	}

	option = {
		name = EVTOPTF_PlusFaction_304 # We should present our demands

		trigger = {
			has_character_flag = can_make_demand

			OR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}

			NOT = {
				has_opinion_modifier = {
					name = ultimatum_refused
					who = liege
				}
			}
		}

		custom_tooltip = {
			text = EVTTOOLTIP1900604

			trigger_switch = {
				on_trigger = leads_faction

				faction_court = {		character_event = { id = PlusFaction.321 } } # Make a demand of liege
				faction_prosperity = {	character_event = { id = PlusFaction.322 } } # Make a demand of liege
				faction_glory = {		character_event = { id = PlusFaction.323 } } # Make a demand of liege
				faction_tradition = {	character_event = { id = PlusFaction.324 } } # Make a demand of liege
			}
		}

		ai_chance = {
			factor = 165

			trigger = {
				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 0.75 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 0.75 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 0.75 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_tradition }
					faction_power = { faction = faction_tradition power >= 0.75 }
				}
			}

			mult_modifier = {
				factor = 2.0

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
			}

			mult_modifier = {
				factor = 4.0

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
			}

			mult_modifier = {
				factor = 6.0

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 3 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 3 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 3 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 3 }
				}
			}

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}

			mult_modifier = {
				factor = 0.01
				liege = { is_primary_war_defender = yes }
			}

			mult_modifier = {
				factor = 2
				trait = craven
			}

			mult_modifier = {
				factor = 0.5
				trait = brave
			}

			mult_modifier = {
				factor = 0.5

				has_game_rule = {
					name = factions_aggression
					value = reduced
				}
			}

			mult_modifier = {
				factor = 1.5

				has_game_rule = {
					name = factions_aggression
					value = high
				}
			}

			mult_modifier = {
				factor = 2.0

				has_game_rule = {
					name = factions_aggression
					value = very_high
				}
			}
		}
	}

	option = {
		name = EVTOPTG_PlusFaction_304 # We should reconcile with our liege

		trigger = {
			OR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
		}

		character_event = {
			id = PlusFaction.313 # Strengthen liege
			tooltip = EVTTOOLTIP1900601
		}

		ai_chance = {
			factor = 50

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

			mult_modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
			}

			mult_modifier = {
				factor = 1.25
				trait = kind
			}

			mult_modifier = {
				factor = 1.25
				trait = humble
			}

			mult_modifier = {
				factor = 1.25
				trait = content
			}

			mult_modifier = {
				factor = 0.75
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.75
				trait = proud
			}

			mult_modifier = {
				factor = 0.75
				trait = envious
			}

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 0.5

				opinion = {
					who = liege
					value < 0
				}
			}
		}
	}

	option = {
		name = EVTOPTH_PlusFaction_304 # We will discuss our complaints in detail

		trigger = { has_character_flag = faction_is_unhappy }

		character_event = {
			id = PlusFaction.317 # Weaken liege
			tooltip = EVTTOOLTIP1900602
		}

		ai_chance = {
			factor = 55

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

			mult_modifier = {
				factor = 0.75
				trait = kind
			}

			mult_modifier = {
				factor = 0.75
				trait = humble
			}

			mult_modifier = {
				factor = 0.75
				trait = content
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 1.25
				trait = envious
			}

			mult_modifier = {
				factor = 0.5

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

			mult_modifier = {
				factor = 0.5

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

			mult_modifier = {
				factor = 0.5

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
			}

			mult_modifier = {
				factor = 0.5

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
			}

			mult_modifier = {
				factor = 0.5

				has_game_rule = {
					name = factions_aggression
					value = reduced
				}
			}

			mult_modifier = {
				factor = 1.5

				has_game_rule = {
					name = factions_aggression
					value = high
				}
			}

			mult_modifier = {
				factor = 2.0

				has_game_rule = {
					name = factions_aggression
					value = very_high
				}
			}
		}
	}

	option = {
		name = EVTOPTI_PlusFaction_304 # We are not yet strong enough to act

		trigger = {
			has_character_flag = faction_is_angry

			liege = {
				is_primary_war_defender = no

				trigger_if = {
					limit = { independent = no }

					will_liege_enforce_peace = no
					has_liege_enforced_peace = no
				}
			}
		}

		character_event = {
			id = PlusFaction.399 # Clear flags
			days = 1
			tooltip = CUSTOMTOOLTIP57
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.305 }
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.5

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 1.5 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}

				opinion = {
					who = liege
					value < 25
				}
			}

			mult_modifier = {
				factor = 0.1

				trigger_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 2 }
				}
				trigger_else_if = {
					limit = { leads_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}

				opinion = {
					who = liege
					value < 25
				}
			}

			mult_modifier = {
				factor = 2
				trait = craven
			}

			mult_modifier = {
				factor = 0.5
				trait = brave
			}

			mult_modifier = {
				factor = 2.0

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

			mult_modifier = {
				factor = 2.0

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

	option = {
		name = EVTOPTJ_PlusFaction_304 # Now is not the time to act

		trigger = {
			has_character_flag = faction_is_angry

			liege = {
				OR = {
					is_primary_war_defender = yes

					trigger_if = {
						limit = { independent = no }

						OR = {
							will_liege_enforce_peace = yes
							has_liege_enforced_peace = yes
						}
					}
				}
			}
		}

		character_event = {
			id = PlusFaction.399 # Clear flags
			days = 1
			tooltip = CUSTOMTOOLTIP59
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.305 }
				}
			}
		}

		ai_chance = { factor = 100 }
	}
}

# Unhappy/Angry faction members told the faction will do nothing
character_event = {
	id = PlusFaction.305
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_305A
		trigger = {
			liege = { is_primary_war_defender = yes }
			FROM = { NOT = { has_character_flag = faction_demand_refused } }
		}
	}
	desc = {
		text = EVTDESC_PlusFaction_305B
		trigger = {
			liege = { is_primary_war_defender = no }
			FROM = { NOT = { has_character_flag = faction_demand_refused } }
		}
	}
	desc = {
		text = EVTDESC_PlusFaction_305C
		trigger = {
			FROM = { has_character_flag = faction_demand_refused }
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_305 # So be it

		trigger = {
			liege = { is_primary_war_defender = yes }
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_305 # I trust his judgement

		trigger = {
			liege = { is_primary_war_defender = no }
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 2
				trait = trusting
			}

			mult_modifier = {
				factor = 1.5
				trait = content
			}

			mult_modifier = {
				factor = 1.5
				trait = humble
			}

			mult_modifier = {
				factor = 1.5
				trait = patient
			}

			mult_modifier = {
				factor = 0.75
				trait = proud
			}

			mult_modifier = {
				factor = 0.75
				trait = wroth
			}

			mult_modifier = {
				factor = 0.75
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5
				trait = paranoid
			}

			mult_modifier = {
				factor = 0.5

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

			mult_modifier = {
				factor = 0.5

				opinion = {
					who = FROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 0.75

				opinion = {
					who = FROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 0.75

				opinion = {
					who = FROM
					value < 0
				}
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value >= 0
				}
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value >= 25
				}
			}

			mult_modifier = {
				factor = 2

				opinion = {
					who = FROM
					value >= 50
				}
			}

			mult_modifier = {
				factor = 3

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

	option = {
		name = EVTOPTC_PlusFaction_305 # This is an outrage!

		trigger = {
			liege = { is_primary_war_defender = no }
		}

		opinion = {
			name = upset_faction_decision
			who = FROM
			years = 10
			multiplier = 2
		}

		ai_chance = {
			factor = 300

			trigger = {
				trigger_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 0.75 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 0.75 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 0.75 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 0.75 }
				}
			}

			mult_modifier = {
				factor = 1.5

				trigger_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 1.5 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 1.5 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 1.5 }
				}
			}

			mult_modifier = {
				factor = 3.0

				trigger_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 2 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 2 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 2 }
				}
			}

			mult_modifier = {
				factor = 5.0

				trigger_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 3 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_prosperity }
					faction_power = { faction = faction_prosperity power >= 3 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_glory }
					faction_power = { faction = faction_glory power >= 3 }
				}
				trigger_else_if = {
					limit = { in_faction = faction_court }
					faction_power = { faction = faction_court power >= 3 }
				}
			}

			mult_modifier = {
				factor = 2
				trait = craven
			}

			mult_modifier = {
				factor = 0.5
				trait = brave
			}

			mult_modifier = {
				factor = 0.5

				has_game_rule = {
					name = factions_aggression
					value = reduced
				}
			}

			mult_modifier = {
				factor = 1.5

				has_game_rule = {
					name = factions_aggression
					value = high
				}
			}

			mult_modifier = {
				factor = 2.0

				has_game_rule = {
					name = factions_aggression
					value = very_high
				}
			}
		}
	}
}

# Happy/Content faction members told the faction will do nothing
character_event = {
	id = PlusFaction.306
	desc = EVTDESC_PlusFaction_306
	picture = GFX_evt_council

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_306 # I don't mind

		ai_chance = {
			factor = 75

			mult_modifier = {
				factor = 1.5
				trait = trusting
			}

			mult_modifier = {
				factor = 1.25
				trait = patient
			}

			mult_modifier = {
				factor = 1.25
				trait = content
			}

			mult_modifier = {
				factor = 1.25
				trait = humble
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value >= 25
				}
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value >= 50
				}
			}

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

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

	option = {
		name = EVTOPTB_PlusFaction_306 # I don't like this

		opinion = {
			name = upset_faction_decision
			who = FROM
			years = 10
		}

		ai_chance = {
			factor = 25

			mult_modifier = {
				factor = 2.0
				trait = wroth
			}

			mult_modifier = {
				factor = 1.5
				trait = paranoid
			}

			mult_modifier = {
				factor = 2.0
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value < 0
				}
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 1.5

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

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = liege
					value < 0
				}
			}

			mult_modifier = {
				factor = 2.0

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

			mult_modifier = {
				factor = 2.0

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

			mult_modifier = {
				factor = 2.0

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

# Notification to faction members that a leader was removed for postponing too many times
character_event = {
	id = PlusFaction.307
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_307A
		trigger = { in_faction = faction_court }
	}
	desc = {
		text = EVTDESC_PlusFaction_307B
		trigger = { in_faction = faction_prosperity }
	}
	desc = {
		text = EVTDESC_PlusFaction_307C
		trigger = { in_faction = faction_glory }
	}
	desc = {
		text = EVTDESC_PlusFaction_307D
		trigger = { in_faction = faction_tradition }
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = OK
	}
}

# Notification to faction members that the meeting must be postponed
letter_event = {
	id = PlusFaction.308
	desc = EVTDESC_PlusFaction_308

	is_triggered_only = yes

	ai = no

	option = {
		name = OK
	}
}

### MEETING AGENDAS & SPEECHES

# Agenda - strengthen self
character_event = {
	id = PlusFaction.310
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_310

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_PlusFaction_310 # Praise self in speech

		random_list = {
			15 = {
				mult_modifier = {
					factor = 0.5
					trait = stutter
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 8
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 5
				}

				mult_modifier = {
					factor = 0.25
					diplomacy < 2
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 20
				}

				set_character_flag = made_great_speech

				character_event = {
					id = PlusFaction.311 # Great speech
					tooltip = EVTTOOLTIP1900700
				}
			}

			25 = {
				mult_modifier = {
					factor = 0.5
					trait = stutter
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 8
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 5
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 2
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 20
				}

				set_character_flag = made_good_speech

				character_event = {
					id = PlusFaction.311 # Good speech
					tooltip = EVTTOOLTIP1900702
				}
			}

			30 = {
				mult_modifier = {
					factor = 0.5
					trait = stutter
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 8
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 5
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 2
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 20
				}

				set_character_flag = made_fair_speech

				character_event = {
					id = PlusFaction.311 # Fair speech
					tooltip = EVTTOOLTIP1900704
				}
			}

			20 = {
				mult_modifier = {
					factor = 1.5
					trait = stutter
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 8
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 5
				}

				mult_modifier = {
					factor = 1.75
					diplomacy < 2
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 0.5
					diplomacy >= 20
				}

				set_character_flag = made_bad_speech

				character_event = {
					id = PlusFaction.311 # Bad speech
					tooltip = EVTTOOLTIP1900706
				}
			}

			10 = {
				mult_modifier = {
					factor = 1.5
					trait = stutter
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 8
				}

				mult_modifier = {
					factor = 1.75
					diplomacy < 5
				}

				mult_modifier = {
					factor = 1.75
					diplomacy < 2
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 0.5
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 0.5
					diplomacy >= 20
				}

				set_character_flag = made_terrible_speech

				character_event = {
					id = PlusFaction.311 # Laughed out of the room
					tooltip = EVTTOOLTIP1900708
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.5
				trait = stutter
			}

			mult_modifier = {
				factor = 0.5
				diplomacy < 8
			}

			mult_modifier = {
				factor = 2.0
				trait = proud
			}

			mult_modifier = {
				factor = 0.25
				trait = humble
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_310 # Request funds for self

		character_event = {
			id = PlusFaction.336
			days = 7
			tooltip = EVTTOOLTIP1900710
		}

		pf_leader_vote_effect = yes

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.335 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 2.0
				trait = greedy
			}

			mult_modifier = {
				factor = 0.25
				trait = charitable
			}
		}
	}

	option = {
		name = NEVERMIND

		character_event = {
			id = PlusFaction.304 # Go back to setting agenda
			tooltip = CUSTOMTOOLTIP55
		}

		ai_chance = { factor = 0 }
	}
}

# Results of speech
character_event = {
	id = PlusFaction.311
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_311_Great
		trigger = { has_character_flag = made_great_speech }
	}
	desc = {
		text = EVTDESC_PlusFaction_311_Good
		trigger = { has_character_flag = made_good_speech }
	}
	desc = {
		text = EVTDESC_PlusFaction_311_Fair
		trigger = { has_character_flag = made_fair_speech }
	}
	desc = {
		text = EVTDESC_PlusFaction_311_Poor
		trigger = { has_character_flag = made_poor_speech }
	}
	desc = {
		text = EVTDESC_PlusFaction_311_Terrible
		trigger = { has_character_flag = made_terrible_speech }
	}

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = {
			text = EVTOPTA_PlusFaction_311
			trigger = { has_character_flag = made_great_speech }
		}
		name = {
			text = EVTOPTB_PlusFaction_311
			trigger = { has_character_flag = made_good_speech }
		}
		name = {
			text = EVTOPTC_PlusFaction_311
			trigger = { has_character_flag = made_fair_speech }
		}
		name = {
			text = EVTOPTD_PlusFaction_311
			trigger = { has_character_flag = made_poor_speech }
		}
		name = {
			text = EVTOPTE_PlusFaction_311
			trigger = { has_character_flag = made_terrible_speech }
		}

		trigger_switch = {
			on_trigger = has_character_flag

			made_great_speech = {
				trigger_switch = {
					on_trigger = real_tier

					KING = { prestige = 200 }
					DUKE = { prestige = 100 }
					fallback = { prestige = 50 }
				}
			}

			made_good_speech = {
				trigger_switch = {
					on_trigger = real_tier

					KING = { prestige = 100 }
					DUKE = { prestige = 50 }
					fallback = { prestige = 25 }
				}
			}

			made_poor_speech = {
				trigger_switch = {
					on_trigger = real_tier

					KING = { prestige = -100 }
					DUKE = { prestige = -50 }
					fallback = { prestige = -25 }
				}
			}

			made_terrible_speech = {
				trigger_switch = {
					on_trigger = real_tier

					KING = { prestige = -200 }
					DUKE = { prestige = -100 }
					fallback = { prestige = -50 }
				}
			}
		}

		custom_tooltip = {
			text = CUSTOMTOOLTIP45

			set_character_flag = former_faction_leader
			set_character_flag = removed_from_leadership
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				hidden_effect = {
					remove_opinion = { who = ROOT name = great_speech }
					remove_opinion = { who = ROOT name = good_speech }
					remove_opinion = { who = ROOT name = okay_speech }
					remove_opinion = { who = ROOT name = bad_speech }
					remove_opinion = { who = ROOT name = terrible_speech }
				}

				if = {
					limit = { ROOT = { has_character_flag = made_great_speech } }
					opinion = { who = ROOT name = great_speech years = 10 }
				}
				else_if = {
					limit = { ROOT = { has_character_flag = made_good_speech } }
					opinion = { who = ROOT name = good_speech years = 10 }
				}
				else_if = {
					limit = { ROOT = { has_character_flag = made_fair_speech } }
					opinion = { who = ROOT name = okay_speech years = 10 }
				}
				else_if = {
					limit = { ROOT = { has_character_flag = made_poor_speech } }
					opinion = { who = ROOT name = bad_speech years = 10 }
				}
				else_if = {
					limit = { ROOT = { has_character_flag = made_terrible_speech } }
					opinion = { who = ROOT name = terrible_speech years = 10 }
				}

				character_event = { id = PlusFaction.312 } # Notify
			}
		}

		character_event = {
			id = PlusFaction.399 # Clear flags
			days = 1
		}
	}
}

# Notify faction members of speech results
character_event = {
	id = PlusFaction.312
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_312_Great
		trigger = { FROM = { has_character_flag = made_great_speech } }
	}
	desc = {
		text = EVTDESC_PlusFaction_312_Good
		trigger = { FROM = { has_character_flag = made_good_speech } }
	}
	desc = {
		text = EVTDESC_PlusFaction_312_Fair
		trigger = { FROM = { has_character_flag = made_fair_speech } }
	}
	desc = {
		text = EVTDESC_PlusFaction_312_Poor
		trigger = { FROM = { has_character_flag = made_poor_speech } }
	}
	desc = {
		text = EVTDESC_PlusFaction_312_Terrible
		trigger = { FROM = { has_character_flag = made_terrible_speech } }
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = {
			text = EVTOPTA_PlusFaction_312
			trigger = { FROM = { has_character_flag = made_great_speech } }
		}
		name = {
			text = EVTOPTB_PlusFaction_312
			trigger = { FROM = { has_character_flag = made_good_speech } }
		}
		name = {
			text = EVTOPTC_PlusFaction_312
			trigger = { FROM = { has_character_flag = made_fair_speech } }
		}
		name = {
			text = EVTOPTD_PlusFaction_312
			trigger = { FROM = { has_character_flag = made_poor_speech } }
		}
		name = {
			text = EVTOPTE_PlusFaction_312
			trigger = { FROM = { has_character_flag = made_terrible_speech } }
		}

		tooltip = {
			if = {
				limit = { FROM = { has_character_flag = made_great_speech } }
				opinion = { who = FROM name = great_speech years = 10 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = made_good_speech } }
				opinion = { who = FROM name = good_speech years = 10 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = made_fair_speech } }
				opinion = { who = FROM name = okay_speech years = 10 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = made_poor_speech } }
				opinion = { who = FROM name = bad_speech years = 10 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = made_terrible_speech } }
				opinion = { who = FROM name = terrible_speech years = 10 }
			}
		}
	}
}

# Agenda - strengthen liege
character_event = {
	id = PlusFaction.313
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_313A
		trigger = {
			OR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
		}
	}
	desc = {
		text = EVTDESC_PlusFaction_313B
		trigger = {
			NOR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
		}
	}

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_PlusFaction_313 # Praise liege in speech

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.5
					has_character_flag = faction_is_angry
				}

				mult_modifier = {
					factor = 0.75
					has_character_flag = faction_is_unhappy
				}

				mult_modifier = {
					factor = 0.75
					trait = stutter
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 8
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 5
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 2
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 20
				}

				set_character_flag = liege_opinion_increased

				character_event = {
					id = PlusFaction.314 # Faction opinion of liege increased
					tooltip = EVTTOOLTIP1900713
				}
			}

			40 = {
				mult_modifier = {
					factor = 0.5
					has_character_flag = faction_is_angry
				}

				mult_modifier = {
					factor = 0.75
					has_character_flag = faction_is_unhappy
				}

				mult_modifier = {
					factor = 0.75
					trait = stutter
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 8
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 5
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 2
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 20
				}

				set_character_flag = liege_opinion_slightly_increased

				character_event = {
					id = PlusFaction.314 # Faction opinion of liege slightly increased
					tooltip = EVTTOOLTIP1900716
				}
			}

			30 = {
				mult_modifier = {
					factor = 2.0
					has_character_flag = faction_is_angry
				}

				mult_modifier = {
					factor = 1.5
					has_character_flag = faction_is_unhappy
				}

				mult_modifier = {
					factor = 1.5
					trait = stutter
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 8
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 5
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 2
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 0.5
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 0.5
					diplomacy >= 20
				}

				set_character_flag = liege_opinion_decreased

				character_event = {
					id = PlusFaction.314 # Faction opinion of liege decreased
					tooltip = EVTTOOLTIP1900719
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.5
				trait = stutter
			}

			mult_modifier = {
				factor = 0.5
				diplomacy < 8
			}

			mult_modifier = {
				factor = 2.0
				trait = proud
			}

			mult_modifier = {
				factor = 0.25
				trait = humble
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_313 # request funds for liege

		trigger = {
			NOR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
		}

		character_event = {
			id = PlusFaction.331
			days = 7
			tooltip = EVTTOOLTIP1900722
		}

		set_character_flag = demand_money_liege
		pf_leader_vote_effect = yes

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.330 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 2.0
				trait = charitable
			}

			mult_modifier = {
				factor = 0.25
				trait = greedy
			}
		}
	}

	option = {
		name = EVTOPTC_PlusFaction_313 # Encourage a show of support

		trigger = {
			NOT = { has_character_flag = faction_is_angry }
		}

		set_character_flag = demand_support_liege
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.331
			days = 7
			tooltip = EVTTOOLTIP1900725
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.330 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.1
				has_character_flag = faction_is_unhappy
			}

			mult_modifier = {
				factor = 2.0
				trait = kind
			}

			mult_modifier = {
				factor = 0.25
				trait = envious
			}
		}
	}

	option = {
		name = NEVERMIND

		character_event = {
			id = PlusFaction.304 # Go back to setting agenda
			tooltip = CUSTOMTOOLTIP55
		}

		ai_chance = { factor = 0 }
	}
}

# Results of speech to support liege
character_event = {
	id = PlusFaction.314
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_314A
		trigger = { has_character_flag = liege_opinion_increased }
	}
	desc = {
		text = EVTDESC_PlusFaction_314B
		trigger = { has_character_flag = liege_opinion_slightly_increased }
	}
	desc = {
		text = EVTDESC_PlusFaction_314C
		trigger = { has_character_flag = liege_opinion_decreased }
	}

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = {
			text = EVTOPTA_PlusFaction_314
			trigger = { has_character_flag = liege_opinion_increased }
		}
		name = {
			text = EVTOPTB_PlusFaction_314
			trigger = { has_character_flag = liege_opinion_slightly_increased }
		}
		name = {
			text = EVTOPTC_PlusFaction_314
			trigger = { has_character_flag = liege_opinion_decreased }
		}

		if = {
			limit = { has_character_flag = liege_opinion_decreased }

			trigger_switch = {
				on_trigger = leads_faction

				faction_court = { liege = { custom_tooltip = { text = COURTFACTIONMOODMINUS } } }
				faction_prosperity = { liege = { custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS } } }
				faction_glory = { liege = { custom_tooltip = { text = GLORYFACTIONMOODMINUS } } }
				faction_tradition = { liege = { custom_tooltip = { text = TRADITIONFACTIONMOODMINUS } } }
			}
		}
		else = {
			trigger_switch = {
				on_trigger = leads_faction

				faction_court = { liege = { custom_tooltip = { text = COURTFACTIONMOODPLUS } } }
				faction_prosperity = { liege = { custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS } } }
				faction_glory = { liege = { custom_tooltip = { text = GLORYFACTIONMOODPLUS } } }
				faction_tradition = { liege = { custom_tooltip = { text = TRADITIONFACTIONMOODPLUS } } }
			}
		}

		hidden_effect = {
			liege = {
				character_event = { id = PlusFaction.316 } # Notify

				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.315 } # Notify
				}
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}
}

# Notify faction members of speech results
character_event = {
	id = PlusFaction.315
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_315A
		trigger = { FROM = { has_character_flag = liege_opinion_increased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_315B
		trigger = { FROM = { has_character_flag = liege_opinion_slightly_increased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_315C
		trigger = { FROM = { has_character_flag = liege_opinion_decreased } }
	}

	is_triggered_only = yes

	option = {
		name = OK

		if = {
			limit = { FROM = { has_character_flag = liege_opinion_increased } }

			opinion = {
				name = convinced_to_support_liege
				who = liege
				years = 10
				multiplier = 2
			}
		}
		else_if = {
			limit = { FROM = { has_character_flag = liege_opinion_slightly_increased } }

			opinion = {
				name = convinced_to_support_liege
				who = liege
				years = 10
			}
		}
		else_if = {
			limit = { FROM = { has_character_flag = liege_opinion_decreased } }

			opinion = {
				name = turned_against_liege
				who = liege
				years = 10
			}

			opinion = {
				name = upset_faction_decision
				who = FROM
				years = 10
			}
		}

		if = {
			limit = {
				FROM = { has_character_flag = faction_is_unhappy }

				opinion = {
					who = liege
					value < 0
				}
			}

			opinion = {
				name = upset_faction_decision
				who = FROM
				years = 10
			}
		}
		else_if = {
			limit = {
				FROM = { has_character_flag = faction_is_angry }

				opinion = {
					who = liege
					value < 0
				}
			}

			opinion = {
				name = upset_faction_decision
				who = FROM
				years = 10
				multiplier = 2
			}
		}
	}
}

# Notify liege of speech results
character_event = {
	id = PlusFaction.316
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_316A
		trigger = { FROM = { has_character_flag = liege_opinion_increased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_316B
		trigger = { FROM = { has_character_flag = liege_opinion_slightly_increased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_316C
		trigger = { FROM = { has_character_flag = liege_opinion_decreased } }
	}

	is_triggered_only = yes

	option = {
		name = {
			text = EXCELLENT
			trigger = { FROM = { has_character_flag = liege_opinion_increased } }
		}
		name = {
			text = OK
			trigger = { FROM = { has_character_flag = liege_opinion_slightly_increased } }
		}
		name = {
			text = CURSES
			trigger = { FROM = { has_character_flag = liege_opinion_decreased } }
		}

		FROM = {
			show_scope_change = no

			if = {
				limit = { has_character_flag = liege_opinion_decreased }

				trigger_switch = {
					on_trigger = leads_faction

					faction_court = { custom_tooltip = { text = COURTFACTIONMOODMINUS } }
					faction_prosperity = { custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS } }
					faction_glory = { custom_tooltip = { text = GLORYFACTIONMOODMINUS } }
					faction_tradition = { custom_tooltip = { text = TRADITIONFACTIONMOODMINUS } }
				}
			}
			else = {
				trigger_switch = {
					on_trigger = leads_faction

					faction_court = { custom_tooltip = { text = COURTFACTIONMOODPLUS } }
					faction_prosperity = { custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS } }
					faction_glory = { custom_tooltip = { text = GLORYFACTIONMOODPLUS } }
					faction_tradition = { custom_tooltip = { text = TRADITIONFACTIONMOODPLUS } }
				}
			}
		}

		if = {
			limit = { FROM = { has_character_flag = liege_opinion_increased } }

			opinion = {
				name = spoke_on_lieges_behalf
				who = FROM
				years = 10
				multiplier = 2
			}
		}
		else_if = {
			limit = { FROM = { has_character_flag = liege_opinion_slightly_increased } }

			opinion = {
				name = spoke_on_lieges_behalf
				who = FROM
				years = 10
			}
		}

		character_event = { id = PlusFaction.200 } # Recalculate faction moods
	}
}

# Agenda - weaken liege
character_event = {
	id = PlusFaction.317
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_317A
		trigger = {
			OR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
		}
	}
	desc = {
		text = EVTDESC_PlusFaction_317B
		trigger = {
			NOR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
		}
	}

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_PlusFaction_317	# Denounce liege in speech

		random_list = {
			30 = {
				mult_modifier = {
					factor = 0.75
					has_character_flag = faction_is_happy
				}

				mult_modifier = {
					factor = 1.5
					has_character_flag = faction_is_unhappy
				}

				mult_modifier = {
					factor = 0.75
					trait = stutter
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 8
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 5
				}

				mult_modifier = {
					factor = 0.5
					diplomacy < 2
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 1.75
					diplomacy >= 20
				}

				set_character_flag = liege_opinion_decreased

				character_event = {
					id = PlusFaction.318 #  Faction opinion of liege decreased
					tooltip = EVTTOOLTIP1900728
				}
			}

			40 = {
				mult_modifier = {
					factor = 0.75
					has_character_flag = faction_is_happy
				}

				mult_modifier = {
					factor = 1.5
					has_character_flag = faction_is_unhappy
				}

				mult_modifier = {
					factor = 0.75
					trait = stutter
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 8
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 5
				}

				mult_modifier = {
					factor = 0.75
					diplomacy < 2
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 1.5
					diplomacy >= 20
				}

				set_character_flag = liege_opinion_slightly_decreased

				character_event = {
					id = PlusFaction.318 # Faction opinion of liege slightly decreased
					tooltip = EVTTOOLTIP1900731
				}
			}

			30 = {
				mult_modifier = {
					factor = 1.5
					has_character_flag = faction_is_happy
				}

				mult_modifier = {
					factor = 0.75
					has_character_flag = faction_is_unhappy
				}

				mult_modifier = {
					factor = 1.5
					trait = stutter
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 8
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 5
				}

				mult_modifier = {
					factor = 1.5
					diplomacy < 2
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 12
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 14
				}

				mult_modifier = {
					factor = 0.75
					diplomacy >= 16
				}

				mult_modifier = {
					factor = 0.5
					diplomacy >= 18
				}

				mult_modifier = {
					factor = 0.5
					diplomacy >= 20
				}

				set_character_flag = liege_opinion_increased

				character_event = {
					id = PlusFaction.318 # Faction opinion of liege increased
					tooltip = EVTTOOLTIP1900734
				}
			}
		}
	}

	option = {
		name = NEVERMIND

		character_event = {
			id = PlusFaction.304 # Go back to setting agenda
			tooltip = CUSTOMTOOLTIP55
		}

		ai_chance = { factor = 0 }
	}
}

# Results of speech to denounce liege
character_event = {
	id = PlusFaction.318
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_318A
		trigger = { has_character_flag = liege_opinion_decreased }
	}
	desc = {
		text = EVTDESC_PlusFaction_318B
		trigger = { has_character_flag = liege_opinion_slightly_decreased }
	}
	desc = {
		text = EVTDESC_PlusFaction_318C
		trigger = { has_character_flag = liege_opinion_increased }
	}

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = {
			text = EVTOPTA_PlusFaction_318
			trigger = { has_character_flag = liege_opinion_decreased }
		}
		name = {
			text = EVTOPTB_PlusFaction_318
			trigger = { has_character_flag = liege_opinion_slightly_decreased }
		}
		name = {
			text = EVTOPTC_PlusFaction_318
			trigger = { has_character_flag = liege_opinion_increased }
		}

		if = {
			limit = { has_character_flag = liege_opinion_increased }

			trigger_switch = {
				on_trigger = leads_faction

				faction_court = { custom_tooltip = { text = COURTFACTIONMOODPLUS } }
				faction_prosperity = { custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS } }
				faction_glory = { custom_tooltip = { text = GLORYFACTIONMOODPLUS } }
				faction_tradition = { custom_tooltip = { text = TRADITIONFACTIONMOODPLUS } }
			}
		}
		else = {
			trigger_switch = {
				on_trigger = leads_faction

				faction_court = { custom_tooltip = { text = COURTFACTIONMOODMINUS } }
				faction_prosperity = { custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS } }
				faction_glory = { custom_tooltip = { text = GLORYFACTIONMOODMINUS } }
				faction_tradition = { custom_tooltip = { text = TRADITIONFACTIONMOODMINUS } }
			}
		}

		hidden_effect = {
			liege = {
				character_event = { id = PlusFaction.320 } # Notify

				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }

					character_event = { id = PlusFaction.319 } # Notify

					if = {
						limit = { ROOT = { has_character_flag = liege_opinion_decreased } }
						opinion = { who = liege name = turned_against_liege years = 10 multiplier = 2 }
					}
					else_if = {
						limit = { ROOT = { has_character_flag = liege_opinion_slightly_decreased } }
						opinion = { who = liege name = turned_against_liege years = 10 }
					}
					else_if = {
						limit = { ROOT = { has_character_flag = liege_opinion_increased } }
						opinion = { who = liege name = convinced_to_support_liege years = 10 }
						opinion = { who = ROOT name = upset_faction_decision years = 10 }
					}

					if = {
						limit = { opinion = { who = liege value >= 0 } }

						if = {
							limit = { ROOT = { has_character_flag = faction_is_content } }
							opinion = { who = ROOT name = upset_faction_decision years = 10 }
						}
						else_if = {
							limit = { ROOT = { has_character_flag = faction_is_happy }  }
							opinion = { who = ROOT name = upset_faction_decision years = 10 multiplier = 2 }
						}
					}
				}
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}
}

# Notify faction members of speech results
character_event = {
	id = PlusFaction.319
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_319A
		trigger = { FROM = { has_character_flag = liege_opinion_decreased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_319B
		trigger = { FROM = { has_character_flag = liege_opinion_slightly_decreased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_319C
		trigger = { FROM = { has_character_flag = liege_opinion_increased } }
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			if = {
				limit = { FROM = { has_character_flag = liege_opinion_decreased } }
				opinion = { who = liege name = turned_against_liege years = 10 multiplier = 2 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = liege_opinion_slightly_decreased } }
				opinion = { who = liege name = turned_against_liege years = 10 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = liege_opinion_increased } }
				opinion = { who = liege name = convinced_to_support_liege years = 10 }
				opinion = { who = FROM name = upset_faction_decision years = 10 }
			}

			if = {
				limit = { opinion = { who = liege value >= 0 } }

				if = {
					limit = { FROM = { has_character_flag = faction_is_content } }
					opinion = { who = FROM name = upset_faction_decision years = 10 }
				}
				else_if = {
					limit = { FROM = { has_character_flag = faction_is_happy }  }
					opinion = { who = FROM name = upset_faction_decision years = 10 multiplier = 2 }
				}
			}
		}
	}
}

# Notify liege of speech results
character_event = {
	id = PlusFaction.320
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_320A
		trigger = { FROM = { has_character_flag = liege_opinion_decreased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_320B
		trigger = { FROM = { has_character_flag = liege_opinion_slightly_decreased } }
	}
	desc = {
		text = EVTDESC_PlusFaction_320C
		trigger = { FROM = { has_character_flag = liege_opinion_increased } }
	}

	is_triggered_only = yes

	option = {
		name = {
			text = CURSES
			trigger = { FROM = { has_character_flag = liege_opinion_decreased } }
		}
		name = {
			text = OK
			trigger = { FROM = { has_character_flag = liege_opinion_slightly_decreased } }
		}
		name = {
			text = EXCELLENT
			trigger = { FROM = { has_character_flag = liege_opinion_increased } }
		}

		if = {
			limit = { FROM = { has_character_flag = liege_opinion_increased } }

			trigger_switch = {
				on_trigger = leads_faction

				faction_court = { custom_tooltip = { text = COURTFACTIONMOODPLUS } }
				faction_prosperity = { custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS } }
				faction_glory = { custom_tooltip = { text = GLORYFACTIONMOODPLUS } }
				faction_tradition = { custom_tooltip = { text = TRADITIONFACTIONMOODPLUS } }
			}
		}
		else = {
			trigger_switch = {
				on_trigger = leads_faction

				faction_court = { custom_tooltip = { text = COURTFACTIONMOODMINUS } }
				faction_prosperity = { custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS } }
				faction_glory = { custom_tooltip = { text = GLORYFACTIONMOODMINUS } }
				faction_tradition = { custom_tooltip = { text = TRADITIONFACTIONMOODMINUS } }
			}
		}

		opinion = {
			name = rallied_against_liege
			who = FROM
			years = 10
			multiplier = 2
		}

		character_event = { id = PlusFaction.200 } # Recalculate faction moods
	}
}

# Agenda - make demand of liege (Court Faction)
character_event = {
	id = PlusFaction.321
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_321

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_PlusFaction_321 # Lower Crown Authority

		trigger = {
			liege = {
				is_tribal = no

				any_demesne_title = {
					higher_real_tier_than = DUKE

					OR = {
						has_law = crown_authority_1
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}
				}
			}
		}

		set_character_flag = demands_lower_CA
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 150

			mult_modifier = {
				factor = 5
				liege = { has_landed_title = e_hre }
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_1
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_2
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_3
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_4
					}
				}
			}

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_321 # Lower Tribal Organization

		trigger = {
			liege = {
				is_tribal = yes
				independent = yes

				OR = {
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		set_character_flag = demands_lower_TO
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 150

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5
				liege = { has_law = tribal_organization_1 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_2 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_3 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_4 }
			}

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
	}

	option = {
		name = EVTOPTL_PlusFaction_321 # Lower Feudal/Iqta Obligations

		trigger = {
			liege = {
				OR = {
					has_law = feudal_obligations_1
					has_law = feudal_obligations_2
					has_law = feudal_obligations_3
					has_law = feudal_obligations_4
					has_law = iqta_obligations_1
					has_law = iqta_obligations_2
					has_law = iqta_obligations_3
					has_law = iqta_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_feudal_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5

				liege = {
					OR = {
						has_law = feudal_obligations_1
						has_law = iqta_obligations_1
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					OR = {
						has_law = feudal_obligations_2
						has_law = iqta_obligations_2
					}
				}
			}

			mult_modifier = {
				factor = 1.5

				liege = {
					OR = {
						has_law = feudal_obligations_3
						has_law = iqta_obligations_3
					}
				}
			}

			mult_modifier = {
				factor = 2.0

				liege = {
					OR = {
						has_law = feudal_obligations_4
						has_law = iqta_obligations_4
					}
				}
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry

				liege = {
					NOR = {
						has_law = feudal_obligations_3
						has_law = iqta_obligations_3
						has_law = feudal_obligations_4
						has_law = iqta_obligations_4
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title

		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					real_tier = COUNT
					location = { is_capital = no }
				}
			}
		}

		set_character_flag = demands_surrender_title
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}

			mult_modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}

			mult_modifier = {
				factor = 1.25
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = envious
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5
				trait = kind
			}

			mult_modifier = {
				factor = 0.5
				trait = content
			}

			mult_modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}

			mult_modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
	}

	option = {
		name = EVTOPTM_PlusFaction_321 # Lower Tribal Obligations

		trigger = {
			is_tribal = yes

			liege = {
				OR = {
					has_law = tribal_obligations_1
					has_law = tribal_obligations_2
					has_law = tribal_obligations_3
					has_law = tribal_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_tribal_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5
				liege = { has_law = tribal_obligations_1 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_obligations_2 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { has_law = tribal_obligations_3 }
			}

			mult_modifier = {
				factor = 2.0
				liege = { has_law = tribal_obligations_4 }
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry

				liege = {
					NOR = {
						has_law = tribal_obligations_3
						has_law = tribal_obligations_4
					}
				}
			}
		}
	}

	option = {
		name = NEVERMIND

		character_event = {
			id = PlusFaction.304 # Go back to setting agenda
			tooltip = CUSTOMTOOLTIP55
		}

		ai_chance = { factor = 0 }
	}
}

# Agenda - make demand of liege (Prosperity Faction)
character_event = {
	id = PlusFaction.322
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_321

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTN_PlusFaction_321 # Lower City Obligations

		trigger = {
			liege = {
				OR = {
					has_law = city_obligations_1
					has_law = city_obligations_2
					has_law = city_obligations_3
					has_law = city_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_city_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 150

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5
				liege = { has_law = city_obligations_1 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = city_obligations_2 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { has_law = city_obligations_3 }
			}

			mult_modifier = {
				factor = 2.0
				liege = { has_law = city_obligations_4 }
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry

				liege = {
					NOR = {
						has_law = city_obligations_3
						has_law = city_obligations_4
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTH_PlusFaction_321 # Demand Wealth

		trigger = {
			liege = {
				wealth >= 100

				NOR = {
					has_character_flag = loan_taken
					has_character_modifier = ai_austerity
				}
			}
		}

		set_character_flag = demands_share_wealth
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 0.5
				trait = charitable
			}

			mult_modifier = {
				factor = 1.25
				liege = { wealth >= 200 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { wealth >= 300 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { wealth >= 400 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { wealth >= 500 }
			}

			mult_modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}

			mult_modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
	}

	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title

		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					real_tier = COUNT
					location = { is_capital = no }
				}
			}
		}

		set_character_flag = demands_surrender_title
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}

			mult_modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}

			mult_modifier = {
				factor = 1.25
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = envious
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5
				trait = kind
			}

			mult_modifier = {
				factor = 0.5
				trait = content
			}

			mult_modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}

			mult_modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
	}

	option = {
		name = EVTOPTO_PlusFaction_321 # Lower Temple Obligations

		trigger = {
			liege = {
				OR = {
					has_law = temple_obligations_1
					has_law = temple_obligations_2
					has_law = temple_obligations_3
					has_law = temple_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_temple_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}

		ai_chance = {
			factor = 10

			trigger = {
				liege = { has_law = temple_obligations_4 }
			}

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry
				is_theocracy = no
			}
		}
	}

	option = {
		name = EVTOPTL_PlusFaction_321 # Lower Feudal/Iqta Obligations

		trigger = {
			liege = {
				OR = {
					has_law = feudal_obligations_1
					has_law = feudal_obligations_2
					has_law = feudal_obligations_3
					has_law = feudal_obligations_4
					has_law = iqta_obligations_1
					has_law = iqta_obligations_2
					has_law = iqta_obligations_3
					has_law = iqta_obligations_4
				}
			}
		}

		ai_chance = {
			factor = 10

			trigger = {
				liege = {
					OR = {
						has_law = feudal_obligations_4
						has_law = iqta_obligations_4
					}
				}
			}

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry
				is_feudal = no
			}
		}

		set_character_flag = demands_lower_feudal_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}
	}

	option = {
		name = EVTOPTM_PlusFaction_321 # Lower Tribal Obligations

		trigger = {
			is_tribal = yes

			liege = {
				OR = {
					has_law = tribal_obligations_1
					has_law = tribal_obligations_2
					has_law = tribal_obligations_3
					has_law = tribal_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_tribal_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 10

			trigger = {
				liege = { has_law = tribal_obligations_4 }
			}

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}
		}
	}

	option = {
		name = NEVERMIND

		character_event = {
			id = PlusFaction.304
			tooltip = CUSTOMTOOLTIP55
		}

		ai_chance = { factor = 0 }
	}
}

# Agenda - make demand of liege (Glory Faction)
character_event = {
	id = PlusFaction.323
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_321

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTL_PlusFaction_321 # Lower Feudal/Iqta Obligations

		trigger = {
			liege = {
				OR = {
					has_law = feudal_obligations_1
					has_law = feudal_obligations_2
					has_law = feudal_obligations_3
					has_law = feudal_obligations_4
					has_law = iqta_obligations_1
					has_law = iqta_obligations_2
					has_law = iqta_obligations_3
					has_law = iqta_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_feudal_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 150

			trigger = {
				liege = {
					OR = {
						has_law = feudal_obligations_3
						has_law = iqta_obligations_3
						has_law = feudal_obligations_4
						has_law = iqta_obligations_4
					}
				}
			}

			mult_modifier = {
				factor = 0.5

				liege = {
					OR = {
						has_law = feudal_obligations_3
						has_law = iqta_obligations_3
					}
				}
			}

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry

				liege = {
					OR = {
						has_law = feudal_obligations_3
						has_law = iqta_obligations_3
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTM_PlusFaction_321 # Lower Tribal Obligations

		trigger = {
			is_tribal = yes

			liege = {
				OR = {
					has_law = tribal_obligations_1
					has_law = tribal_obligations_2
					has_law = tribal_obligations_3
					has_law = tribal_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_tribal_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Bote
				}
			}
		}

		ai_chance = {
			factor = 150

			trigger = {
				liege = {
					OR = {
						has_law = tribal_obligations_3
						has_law = tribal_obligations_4
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				liege = { has_law = tribal_obligations_3 }
			}

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry
				liege = { has_law = tribal_obligations_3 }
			}
		}
	}

	option = {
		name = EVTOPTA_PlusFaction_321 # Lower Crown Authority

		trigger = {
			liege = {
				is_tribal = no

				any_demesne_title = {
					higher_real_tier_than = DUKE

					OR = {
						has_law = crown_authority_1
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}
				}
			}
		}

		set_character_flag = demands_lower_CA
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 125

			mult_modifier = {
				factor = 5
				liege = { has_landed_title = e_hre }
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_1
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_2
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_3
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_4
					}
				}
			}

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_321 # Lower Tribal Organization

		trigger = {
			liege = {
				is_tribal = yes
				independent = yes

				OR = {
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		set_character_flag = demands_lower_TO
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 125

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5
				liege = { has_law = tribal_organization_1 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_2 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { has_law = tribal_organization_3 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_4 }
			}

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
	}

	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title

		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					real_tier = COUNT
					location = { is_capital = no }
				}
			}
		}

		set_character_flag = demands_surrender_title
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}

			mult_modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}

			mult_modifier = {
				factor = 1.25
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = envious
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5
				trait = kind
			}

			mult_modifier = {
				factor = 0.5
				trait = content
			}

			mult_modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}

			mult_modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
	}

	option = {
		name = NEVERMIND

		character_event = {
			id = PlusFaction.304
			tooltip = CUSTOMTOOLTIP55
		}

		ai_chance = { factor = 0 }
	}
}

# Agenda - make demand of liege (Tradition Faction)
character_event = {
	id = PlusFaction.324
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_321

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTO_PlusFaction_321 # Lower Temple Obligations

		trigger = {
			liege = {
				OR = {
					has_law = temple_obligations_1
					has_law = temple_obligations_2
					has_law = temple_obligations_3
					has_law = temple_obligations_4
				}
			}
		}

		set_character_flag = demands_lower_temple_obligations
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 150

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5
				liege = { has_law = temple_obligations_1 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = temple_obligations_2 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { has_law = temple_obligations_3 }
			}

			mult_modifier = {
				factor = 2.0
				liege = { has_law = temple_obligations_4 }
			}

			mult_modifier = {
				factor = 0.25

				has_character_flag = faction_is_angry

				liege = {
					NOR = {
						has_law = temple_obligations_3
						has_law = temple_obligations_4
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTJ_PlusFaction_321 # Revert Succession Law

		trigger = {
			liege = {
				primary_title = {
					trigger_if = {
						limit = { has_title_flag = former_gavelkind }
						NOT = { has_law = succ_gavelkind }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_seniority }
						NOT = { has_law = succ_seniority }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_primogeniture }
						NOT = { has_law = succ_primogeniture }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_feudal_elective }
						NOT = { has_law = succ_feudal_elective }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_hre_elective }
						NOT = { has_law = succ_hre_elective }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_byzantine_elective }
						NOT = { has_law = succ_byzantine_elective }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_tanistry }
						NOT = { has_law = succ_tanistry }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_eldership }
						NOT = { has_law = succ_eldership }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_ultimogeniture }
						NOT = { has_law = succ_ultimogeniture }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_agnatic_succession }
						NOT = { has_law = agnatic_succession }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_cognatic_succession }
						NOT = { has_law = cognatic_succession }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_true_cognatic_succession }
						NOT = { has_law = true_cognatic_succession }
					}
					trigger_else_if = {
						limit = { has_title_flag = former_enatic_cognatic_succession }
						NOT = { has_law = enatic_cognatic_succession }
					}
					trigger_else = {
						has_title_flag = former_enatic_succession
						NOT = { has_law = enatic_succession }
					}
				}
			}
		}

		set_character_flag = demands_revert_succession
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 1.5
				trait = content
			}

			mult_modifier = {
				factor = 1.5
				trait = zealous
			}

			mult_modifier = {
				factor = 0.75
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
	}

	option = {
		name = EVTOPTK_PlusFaction_321 # Council Life Terms

		trigger = {
			liege = { has_law = council_privileges_0 }
		}

		set_character_flag = demands_council_life_terms
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
			}
		}
	}

	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title

		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					real_tier = COUNT
					location = { is_capital = no }
				}
			}
		}

		set_character_flag = demands_surrender_title
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}

			mult_modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}

			mult_modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}

			mult_modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}

			mult_modifier = {
				factor = 1.25
				trait = greedy
			}

			mult_modifier = {
				factor = 1.25
				trait = envious
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5
				trait = kind
			}

			mult_modifier = {
				factor = 0.5
				trait = content
			}

			mult_modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}

			mult_modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
	}

	option = {
		name = EVTOPTA_PlusFaction_321 # Lower Crown Authority

		trigger = {
			liege = {
				is_tribal = no

				any_demesne_title = {
					higher_real_tier_than = DUKE

					OR = {
						has_law = crown_authority_1
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}
				}
			}
		}

		set_character_flag = demands_lower_CA
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 10
				liege = { has_landed_title = e_hre }
			}

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_1
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_2
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_3
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				liege = {
					any_demesne_title = {
						higher_real_tier_than = DUKE
						has_law = crown_authority_4
					}
				}
			}

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_321 # Lower Tribal Organization

		trigger = {
			liege = {
				is_tribal = yes
				independent = yes

				OR = {
					has_law = tribal_organization_1
					has_law = tribal_organization_2
					has_law = tribal_organization_3
					has_law = tribal_organization_4
				}
			}
		}

		set_character_flag = demands_lower_TO
		pf_leader_vote_effect = yes

		character_event = {
			id = PlusFaction.340
			days = 7
			tooltip = EVTTOOLTIP1900740
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } # Vote
				}
			}
		}

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 1.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 0.5
				liege = { has_law = tribal_organization_1 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_2 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_3 }
			}

			mult_modifier = {
				factor = 1.25
				liege = { has_law = tribal_organization_4 }
			}

			mult_modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
	}

	option = {
		name = NEVERMIND

		character_event = {
			id = PlusFaction.304
			tooltip = CUSTOMTOOLTIP55
		}

		ai_chance = { factor = 0 }
	}
}

### VOTE RESULTS

# Faction member votes on whether or not to support liege
character_event = {
	id = PlusFaction.330
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_330A
		trigger = { FROM = { has_character_flag = demand_money_liege } }
	}
	desc = {
		text = EVTDESC_PlusFaction_330B
		trigger = { FROM = { has_character_flag = demand_support_liege } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_330 # Vote yes

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_effect = yes }

			opinion = {
				name = opinion_supported_in_meeting
				who = ROOT
				years = 3
			}
		}

		ai_chance = {
			factor = 35

			mult_modifier = {
				factor = 1.5
				liege = { ai = yes }
				FROM = { ai = yes }
			}

			mult_modifier = {
				factor = 0.5
				FROM = { has_character_flag = faction_is_unhappy }
			}

			mult_modifier = {
				factor = 0.1
				FROM = { has_character_flag = faction_is_angry }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < 0 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value < -90 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < 0 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -90 }
			}

			mult_modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = proud
			}

			mult_modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_money_liege }
				trait = greedy
			}

			mult_modifier = {
				factor = 0.5

				FROM = { has_character_flag = demand_money_liege }

				trigger_if = {
					limit = { real_tier = KING }
					wealth < 30
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					wealth < 20
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					wealth < 10
				}
				trigger_else = {
					wealth < 5
				}
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_glory
				}

				trigger_if = {
					limit = { real_tier = KING }
					prestige < 250
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					prestige < 100
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					prestige < 50
				}
				trigger_else = {
					prestige < 25
				}
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_tradition
				}

				trigger_if = {
					limit = { real_tier = KING }
					piety < 100
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					piety < 50
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					piety < 25
				}
				trigger_else = {
					piety < 5
				}
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_330 # Vote no

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_against_effect = yes }

			opinion = {
				name = opinion_opposed_in_meeting
				who = ROOT
				years = 3
			}
		}

		if = {
			limit = { opinion = { who = liege value < 0 } }

			if = {
				limit = { FROM = { has_character_flag = faction_is_content } }
				opinion = { who = FROM name = upset_faction_decision years = 10 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = faction_is_unhappy } }
				opinion = { who = FROM name = upset_faction_decision years = 10 multiplier = 2 }
			}
			else_if = {
				limit = { FROM = { has_character_flag = faction_is_angry } }
				opinion = { who = FROM name = upset_faction_decision years = 10 multiplier = 3 }
			}
		}

		ai_chance = {
			factor = 65

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = liege value >= 90 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 90 }
			}

			mult_modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = humble
			}

			mult_modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = content
			}

			mult_modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_money_liege }
				trait = charitable
			}

			mult_modifier = {
				factor = 0.5

				FROM = { has_character_flag = demand_money_liege }

				trigger_if = {
					limit = { real_tier = KING }
					wealth >= 90
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					wealth >= 60
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					wealth >= 30
				}
				trigger_else = {
					wealth >= 15
				}
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_glory
				}

				trigger_if = {
					limit = { real_tier = KING }
					prestige >= 1000
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					prestige >= 500
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					prestige >= 250
				}
				trigger_else = {
					prestige >= 100
				}
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_tradition
				}

				trigger_if = {
					limit = { real_tier = KING }
					prestige >= 500
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					prestige >= 250
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					prestige >= 100
				}
				trigger_else = {
					prestige >= 50
				}
			}
		}
	}
}

# Results on vote to support liege
character_event = {
	id = PlusFaction.331
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_331A
		trigger = { has_character_flag = demand_money_liege }
	}
	desc = {
		text = EVTDESC_PlusFaction_331B
		trigger = { has_character_flag = demand_support_liege }
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no
		NOT = { has_character_flag = former_faction_leader }
	}

	option = {
		name = EVTOPTA_PlusFaction_331 # Vote passed

		trigger = {
			check_variable = {
				which = faction_votes
				value >= 0
			}
		}

		if = {
			limit = { has_character_flag = demand_money_liege }

			tooltip = {
				trigger_switch = {
					on_trigger = real_tier

					BARON = { transfer_scaled_wealth = { to = liege value = 1 min = 5  max = 5  } }
					COUNT = { transfer_scaled_wealth = { to = liege value = 1 min = 10 max = 10 } }
					DUKE  = { transfer_scaled_wealth = { to = liege value = 1 min = 20 max = 20 } }
					KING  = { transfer_scaled_wealth = { to = liege value = 1 min = 30 max = 30 } }
				}
			}
		}
		else_if = {
			limit = { has_character_flag = demand_support_liege }

			if = {
				limit = { leads_faction = faction_glory }

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = TRANSFER_25_PRESTIGE_TO  prestige = -25  } }
					COUNT = { custom_tooltip = { text = TRANSFER_50_PRESTIGE_TO  prestige = -50  } }
					DUKE  = { custom_tooltip = { text = TRANSFER_100_PRESTIGE_TO prestige = -100 } }
					KING  = { custom_tooltip = { text = TRANSFER_250_PRESTIGE_TO prestige = -250 } }
				}
			}
			else_if = {
				limit = { leads_faction = faction_tradition }

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = TRANSFER_5_PIETY_TO   piety = -5   } }
					COUNT = { custom_tooltip = { text = TRANSFER_25_PIETY_TO  piety = -25  } }
					DUKE  = { custom_tooltip = { text = TRANSFER_50_PIETY_TO  piety = -50  } }
					KING  = { custom_tooltip = { text = TRANSFER_100_PIETY_TO piety = -100 } }
				}
			}
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.332 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}

			letter_event = {
				id = PlusFaction.334
				tooltip = EVTTOOLTIPGIFT
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_331 # Vote failed

		trigger = {
			check_variable = {
				which = faction_votes
				value < 0
			}
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.333 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}
}

# Faction member notified of "yes" vote
character_event = {
	id = PlusFaction.332
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_332A
		trigger = { FROM = { has_character_flag = demand_money_liege } }
	}
	desc = {
		text = EVTDESC_PlusFaction_332B
		trigger = { FROM = { has_character_flag = demand_support_liege } }
	}

	is_triggered_only = yes

	option = {
		name = OK

		if = {
			limit = { FROM = { has_character_flag = demand_money_liege } }

			tooltip = {
				trigger_switch = {
					on_trigger = real_tier

					BARON = { transfer_scaled_wealth = { to = liege value = 1 min = 5  max = 5  } }
					COUNT = { transfer_scaled_wealth = { to = liege value = 1 min = 10 max = 10 } }
					DUKE  = { transfer_scaled_wealth = { to = liege value = 1 min = 20 max = 20 } }
					KING  = { transfer_scaled_wealth = { to = liege value = 1 min = 30 max = 30 } }
				}
			}
		}
		else_if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					in_faction = faction_glory
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { custom_tooltip = { text = TRANSFER_25_PRESTIGE_TO  prestige = -25  } }
				COUNT = { custom_tooltip = { text = TRANSFER_50_PRESTIGE_TO  prestige = -50  } }
				DUKE  = { custom_tooltip = { text = TRANSFER_100_PRESTIGE_TO prestige = -100 } }
				KING  = { custom_tooltip = { text = TRANSFER_250_PRESTIGE_TO prestige = -250 } }
			}
		}
		else_if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					in_faction = faction_tradition
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { custom_tooltip = { text = TRANSFER_5_PIETY_TO   piety = -5   } }
				COUNT = { custom_tooltip = { text = TRANSFER_25_PIETY_TO  piety = -25  } }
				DUKE  = { custom_tooltip = { text = TRANSFER_50_PIETY_TO  piety = -50  } }
				KING  = { custom_tooltip = { text = TRANSFER_100_PIETY_TO piety = -100 } }
			}
		}

		if = {
			limit = {
				reverse_has_opinion_modifier = {
					name = opinion_supported_in_meeting
					who = FROM
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
				COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
				DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
				KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
			}
		}
		else_if = {
			limit = {
				reverse_has_opinion_modifier = {
					name = opinion_opposed_in_meeting
					who = FROM
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
				COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
				DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
				KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
			}
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_from_faction_backer_trigger = yes }

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = FROM
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = FROM
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}
	}
}

# Faction member notified of "no" vote
character_event = {
	id = PlusFaction.333
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_333A
		trigger = { FROM = { has_character_flag = demand_money_liege } }
	}
	desc = {
		text = EVTDESC_PlusFaction_333B
		trigger = { FROM = { has_character_flag = demand_support_liege } }
	}

	is_triggered_only = yes

	option = {
		name = OK

		if = {
			limit = {
				reverse_has_opinion_modifier = {
					name = opinion_supported_in_meeting
					who = FROM
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
				COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
				DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
				KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
			}
		}
		else_if = {
			limit = {
				reverse_has_opinion_modifier = {
					name = opinion_opposed_in_meeting
					who = FROM
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
				COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
				DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
				KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
			}
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_from_faction_backer_trigger = yes }

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = FROM
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = FROM
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}
	}
}

# Liege notified of "yes" vote
letter_event = {
	id = PlusFaction.334

	desc = {
		text = EVTDESC_PlusFaction_334A
		trigger = { FROM = { has_character_flag = demand_money_liege } }
	}
	desc = {
		text = EVTDESC_PlusFaction_334B
		trigger = { FROM = { has_character_flag = demand_support_liege } }
	}

	is_triggered_only = yes

	immediate = {
		if = {
			limit = {
				FROM = { leads_faction = faction_court }
				has_character_modifier = faction_court_bonus
			}
			remove_character_modifier = faction_court_bonus
		}

		if = {
			limit = {
				FROM = { leads_faction = faction_prosperity }
				has_character_modifier = faction_prosperity_bonus
			}
			remove_character_modifier = faction_prosperity_bonus
		}
	}

	option = {
		name = EXCELLENT

		if = {
			limit = { FROM = { has_character_flag = demand_money_liege } }

			any_vassal = {
				show_scope_change = no

				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
				}

				trigger_switch = {
					on_trigger = real_tier

					BARON = { transfer_scaled_wealth = { to = liege value = 1 min = 5  max = 5  } }
					COUNT = { transfer_scaled_wealth = { to = liege value = 1 min = 10 max = 10 } }
					DUKE  = { transfer_scaled_wealth = { to = liege value = 1 min = 20 max = 20 } }
					KING  = { transfer_scaled_wealth = { to = liege value = 1 min = 30 max = 30 } }
				}

				hidden_effect = {
					reverse_opinion = {
						name = opinion_pleased
						who = ROOT
						years = 5
					}
				}
			}
		}

		else_if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_court
				}
			}

			add_character_modifier = {
				name = faction_court_bonus
				years = 5
			}

			hidden_effect = {
				any_vassal = {
					limit = { in_faction = faction_court }

					reverse_opinion = {
						name = opinion_pleased
						who = ROOT
						years = 5
					}
				}
			}
		}

		else_if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_prosperity
				}
			}

			add_character_modifier = {
				name = faction_prosperity_bonus
				years = 5
			}

			hidden_effect = {
				any_vassal = {
					limit = { in_faction = faction_prosperity }

					reverse_opinion = {
						name = opinion_pleased
						who = ROOT
						years = 5
					}
				}
			}
		}

		else_if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_glory
				}
			}

			any_vassal = {
				show_scope_change = no

				limit = { in_faction = faction_glory }

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = TRANSFER_25_PRESTIGE_FROM  ROOT = { prestige = 25  } } }
					COUNT = { custom_tooltip = { text = TRANSFER_50_PRESTIGE_FROM  ROOT = { prestige = 50  } } }
					DUKE  = { custom_tooltip = { text = TRANSFER_100_PRESTIGE_FROM ROOT = { prestige = 100 } } }
					KING  = { custom_tooltip = { text = TRANSFER_250_PRESTIGE_FROM ROOT = { prestige = 250 } } }
				}

				hidden_effect = {
					reverse_opinion = {
						name = opinion_pleased
						who = ROOT
						years = 5
					}
				}
			}
		}

		else_if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_tradition
				}
			}

			any_vassal = {
				show_scope_change = no

				limit = { in_faction = faction_tradition }

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = TRANSFER_5_PIETY_FROM   ROOT = { piety = 5   } } }
					COUNT = { custom_tooltip = { text = TRANSFER_25_PIETY_FROM  ROOT = { piety = 25  } } }
					DUKE  = { custom_tooltip = { text = TRANSFER_50_PIETY_FROM  ROOT = { piety = 50  } } }
					KING  = { custom_tooltip = { text = TRANSFER_100_PIETY_FROM ROOT = { piety = 100 } } }
				}

				hidden_effect = {
					reverse_opinion = {
						name = opinion_pleased
						who = ROOT
						years = 5
					}
				}
			}
		}
	}
}

# Faction member votes on whether or not to give money to faction leader
character_event = {
	id = PlusFaction.335
	desc = EVTDESC_PlusFaction_335
	picture = GFX_evt_council

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_335 # Vote yes

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_effect = yes }

			opinion = {
				name = opinion_supported_in_meeting
				who = ROOT
				years = 3
			}
		}

		ai_chance = {
			factor = 35

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < 0 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -90 }
			}

			mult_modifier = {
				factor = 0.5
				trait = greedy
			}

			mult_modifier = {
				factor = 0.5

				trigger_if = {
					limit = { real_tier = KING }
					wealth < 30
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					wealth < 20
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					wealth < 10
				}
				trigger_else = {
					wealth < 5
				}
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_330 # Vote no

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_against_effect = yes }

			opinion = {
				name = opinion_opposed_in_meeting
				who = ROOT
				years = 3
			}
		}

		if = {
			limit = { ai = yes }

			random_list = {
				50 = {
					trigger = {
						opinion = {
							who = FROM
							value >= 0
						}
					}
					# No effect
				}

				50 = {
					opinion = {
						name = upset_faction_decision
						who = FROM
						years = 10
					}
				}

				50 = {
					trigger = {
						opinion = {
							who = FROM
							value < 0
						}
					}

					mult_modifier = {
						factor = 2
						opinion = { who = FROM value < -25 }
					}

					mult_modifier = {
						factor = 2
						opinion = { who = FROM value < -50 }
					}

					opinion = {
						name = upset_faction_decision
						who = FROM
						years = 10
						multiplier = 2
					}
				}
			}
		}

		ai_chance = {
			factor = 65

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 90 }
			}

			mult_modifier = {
				factor = 0.5
				trait = charitable
			}

			mult_modifier = {
				factor = 0.5

				trigger_if = {
					limit = { real_tier = KING }
					wealth >= 60
				}
				trigger_else_if = {
					limit = { real_tier = DUKE }
					wealth >= 40
				}
				trigger_else_if = {
					limit = { real_tier = COUNT }
					wealth >= 20
				}
				trigger_else = {
					wealth >= 10
				}
			}
		}
	}
}

# Results on vote to give money to faction leader
character_event = {
	id = PlusFaction.336
	desc = EVTDESC_PlusFaction_336
	picture = GFX_evt_council

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no
		NOT = { has_character_flag = former_faction_leader }
	}

	option = {
		name = EVTOPTA_PlusFaction_331 # Vote passed

		trigger = {
			check_variable = {
				which = faction_votes
				value >= 0
			}
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				trigger_switch = {
					on_trigger = real_tier

					BARON = { transfer_scaled_wealth = { to = ROOT value = 1 min = 5  max = 5  } }
					COUNT = { transfer_scaled_wealth = { to = ROOT value = 1 min = 30 max = 10 } }
					DUKE  = { transfer_scaled_wealth = { to = ROOT value = 1 min = 30 max = 20 } }
					KING  = { transfer_scaled_wealth = { to = ROOT value = 1 min = 30 max = 30 } }
				}

				character_event = { id = PlusFaction.337 } # Notify
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_331 # Vote failed

		trigger = {
			check_variable = {
				which = faction_votes
				value < 0
			}
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.338 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}
}

# Faction member notified of "yes" vote
character_event = {
	id = PlusFaction.337
	desc = EVTDESC_PlusFaction_337
	picture = GFX_evt_council

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			trigger_switch = {
				on_trigger = real_tier

				BARON = { transfer_scaled_wealth = { to = FROM value = 1 min = 5  max = 5  } }
				COUNT = { transfer_scaled_wealth = { to = FROM value = 1 min = 30 max = 10 } }
				DUKE  = { transfer_scaled_wealth = { to = FROM value = 1 min = 30 max = 20 } }
				KING  = { transfer_scaled_wealth = { to = FROM value = 1 min = 30 max = 30 } }
			}

			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
					COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
					DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
					KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
				}
			}

			liege = {
				show_scope_change = no

				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
				}
			}
		}
	}
}

# Faction member notified of "no" vote
character_event = {
	id = PlusFaction.338
	desc = EVTDESC_PlusFaction_338
	picture = GFX_evt_council

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
					COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
					DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
					KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
				}
			}

			liege = {
				show_scope_change = no

				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
				}
			}
		}
	}
}

# Faction member votes on whether to demand something from the liege
character_event = {
	id = PlusFaction.339
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_339A
		trigger = { FROM = { has_character_flag = demands_lower_CA } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339B
		trigger = { FROM = { has_character_flag = demands_lower_TO } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339E
		trigger = { FROM = { has_character_flag = demands_surrender_title } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339H
		trigger = { FROM = { has_character_flag = demands_share_wealth } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339J
		trigger = { FROM = { has_character_flag = demands_revert_succession } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339K
		trigger = { FROM = { has_character_flag = demands_council_life_terms } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339L
		trigger = { FROM = { has_character_flag = demands_lower_feudal_obligations } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339M
		trigger = { FROM = { has_character_flag = demands_lower_tribal_obligations } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339N
		trigger = { FROM = { has_character_flag = demands_lower_city_obligations } }
	}
	desc = {
		text = EVTDESC_PlusFaction_339O
		trigger = { FROM = { has_character_flag = demands_lower_temple_obligations } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_339 # Vote yes

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_effect = yes }

			opinion = {
				name = opinion_supported_in_meeting
				who = ROOT
				years = 3
			}
		}

		ai_chance = {
			factor = 75

			mult_modifier = {
				factor = 0.5

				has_opinion_modifier = {
					name = sworn_to_support_heir
					who = liege
				}

				NOT = { trait = deceitful }
			}

			mult_modifier = {
				factor = 0.1
				liege = { is_primary_war_defender = yes }
			}

			mult_modifier = {
				factor = 0.1

				FROM = {
					trigger_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power < 0.75 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_prosperity }
						faction_power = { faction = faction_prosperity power < 0.75 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_tradition }
						faction_power = { faction = faction_tradition power < 0.75 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power < 0.75 }
					}
				}
			}

			mult_modifier = {
				factor = 1.5

				FROM = {
					trigger_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power >= 2 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_prosperity }
						faction_power = { faction = faction_prosperity power >= 2 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_tradition }
						faction_power = { faction = faction_tradition power >= 2 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power >= 2 }
					}
				}
			}

			mult_modifier = {
				factor = 1.5

				FROM = {
					trigger_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power >= 3 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_prosperity }
						faction_power = { faction = faction_prosperity power >= 3 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_tradition }
						faction_power = { faction = faction_tradition power >= 3 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power >= 3 }
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				in_faction = faction_court

				FROM = {
					OR = {
						has_character_flag = demands_lower_CA
						has_character_flag = demands_lower_TO
						has_character_flag = demands_lower_feudal_obligations
						has_character_flag = demands_lower_tribal_obligations
						has_character_flag = demands_surrender_title
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				in_faction = faction_prosperity

				FROM = {
					OR = {
						has_character_flag = demands_tax_privilege
						has_character_flag = demands_lower_city_obligations
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				in_faction = faction_glory

				FROM = {
					OR = {
						has_character_flag = demands_lower_feudal_obligations
						has_character_flag = demands_lower_tribal_obligations
						has_character_flag = demands_levy_privilege
						has_character_flag = demands_surrender_title
					}
				}
			}

			mult_modifier = {
				factor = 1.25

				in_faction = faction_tradition

				FROM = {
					OR = {
						has_character_flag = demands_lower_temple_obligations
						has_character_flag = demands_revert_succession
						has_character_flag = demands_surrender_title
					}
				}
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 10 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 20 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 30 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 40 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 50 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 60 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 70 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 80 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value = 90 }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = 0 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -10 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -20 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -30 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -40 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -50 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -60 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -70 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -80 } }
			}

			mult_modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -90 } }
			}

			mult_modifier = {
				factor = 1.1

				FROM = { has_character_flag = demands_surrender_title }

				event_target:faction_demanded_title_for = {
					NOR = {
						character = ROOT
						character = FROM
					}

					reverse_opinion = {
						who = ROOT
						value >= 25
					}
				}
			}

			mult_modifier = {
				factor = 1.1

				FROM = { has_character_flag = demands_surrender_title }

				event_target:faction_demanded_title_for = {
					NOR = {
						character = ROOT
						character = FROM
					}

					reverse_opinion = {
						who = ROOT
						value >= 50
					}
				}
			}

			mult_modifier = {
				factor = 1.1

				FROM = { has_character_flag = demands_surrender_title }

				event_target:faction_demanded_title_for = {
					NOR = {
						character = ROOT
						character = FROM
					}

					reverse_opinion = {
						who = ROOT
						value >= 75
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				trait = craven
			}

			mult_modifier = {
				factor = 0.5
				trait = humble
			}

			mult_modifier = {
				factor = 0.5
				trait = content
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					OR = {
						has_character_flag = demands_share_wealth
						has_character_flag = demands_surrender_title
					}
				}

				trait = charitable
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					OR = {
						has_character_flag = demands_share_wealth
						has_character_flag = demands_surrender_title
					}
				}

				trait = kind
			}

			mult_modifier = {
				factor = 0.5

				FROM = { has_character_flag = demands_share_wealth }
				scaled_wealth = 5.0
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_339 # Vote no

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_against_effect = yes }

			opinion = {
				name = opinion_opposed_in_meeting
				who = ROOT
				years = 3
			}
		}

		ai_chance = {
			factor = 25

			mult_modifier = {
				factor = 0.1

				character = event_target:faction_demanded_title_for
				FROM = { has_character_flag = demands_surrender_title }
			}

			mult_modifier = {
				factor = 3.0
				FROM = { NOT = { has_character_flag = faction_is_angry } }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < 0 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -10 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -20 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -30 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -40 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -50 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -60 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -70 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -80 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -90 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 10 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 20 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 30 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 40 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 50 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 60 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 70 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 80 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = FROM value >= 90 }
			}

			mult_modifier = {
				factor = 1.1

				FROM = { has_character_flag = demands_surrender_title }

				event_target:faction_demanded_title_for = {
					NOR = {
						character = ROOT
						character = FROM
					}

					reverse_opinion = {
						who = ROOT
						value < -25
					}
				}
			}

			mult_modifier = {
				factor = 1.1

				FROM = { has_character_flag = demands_surrender_title }

				event_target:faction_demanded_title_for = {
					NOR = {
						character = ROOT
						character = FROM
					}

					reverse_opinion = {
						who = ROOT
						value < -50
					}
				}
			}

			mult_modifier = {
				factor = 1.1

				FROM = { has_character_flag = demands_surrender_title }

				event_target:faction_demanded_title_for = {
					NOR = {
						character = ROOT
						character = FROM
					}

					reverse_opinion = {
						who = ROOT
						value < -75
					}
				}
			}

			mult_modifier = {
				factor = 0.5
				trait = proud
			}

			mult_modifier = {
				factor = 0.5
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					OR = {
						has_character_flag = demands_lower_feudal_obligations
						has_character_flag = demands_lower_tribal_obligations
						has_character_flag = demands_lower_city_obligations
						has_character_flag = demands_lower_temple_obligations
						has_character_flag = demands_share_wealth
						has_character_flag = demands_surrender_title
					}
				}

				trait = greedy
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					OR = {
						has_character_flag = demands_surrender_title
						has_character_flag = demands_share_wealth
					}
				}

				trait = envious
			}

			mult_modifier = {
				factor = 0.5

				FROM = { has_character_flag = demands_share_wealth }
				wealth < 0
			}
		}
	}
}

# Result of the vote on whether to demand something from the liege
character_event = {
	id = PlusFaction.340
	picture = GFX_evt_council

	desc = {
		text = EVTDESC_PlusFaction_340A
		trigger = { has_character_flag = demands_lower_CA }
	}
	desc = {
		text = EVTDESC_PlusFaction_340B
		trigger = { has_character_flag = demands_lower_TO }
	}
	desc = {
		text = EVTDESC_PlusFaction_340C
		trigger = { has_character_flag = demands_tax_privilege }
	}
	desc = {
		text = EVTDESC_PlusFaction_340D
		trigger = { has_character_flag = demands_levy_privilege }
	}
	desc = {
		text = EVTDESC_PlusFaction_340E
		trigger = { has_character_flag = demands_surrender_title }
	}
	desc = {
		text = EVTDESC_PlusFaction_340H
		trigger = { has_character_flag = demands_share_wealth }
	}
	desc = {
		text = EVTDESC_PlusFaction_340J
		trigger = { has_character_flag = demands_revert_succession }
	}
	desc = {
		text = EVTDESC_PlusFaction_340K
		trigger = { has_character_flag = demands_council_life_terms }
	}
	desc = {
		text = EVTDESC_PlusFaction_340L
		trigger = { has_character_flag = demands_lower_feudal_obligations }
	}
	desc = {
		text = EVTDESC_PlusFaction_340M
		trigger = { has_character_flag = demands_lower_tribal_obligations }
	}
	desc = {
		text = EVTDESC_PlusFaction_340N
		trigger = { has_character_flag = demands_lower_city_obligations }
	}
	desc = {
		text = EVTDESC_PlusFaction_340O
		trigger = { has_character_flag = demands_lower_temple_obligations }
	}

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no
		NOT = { has_character_flag = former_faction_leader }
	}

	option = {
		name = EVTOPTA_PlusFaction_331 # Vote passed

		trigger = {
			check_variable = {
				which = faction_votes
				value >= 0
			}
		}

		set_character_flag = civil_war_faction_leader

		character_event = {
			id = PlusFaction.461 # civil_war_faction_leader flag removal
			days = 1
		}

		character_event = {
			id = PlusFaction.418 # Follow-up event to present ultimatum
			days = 7
		}

		# Save the title and beneficiary if this is a title demand
		if = {
			limit = { has_character_flag = demands_surrender_title }

			event_target:faction_demanded_title = {
				ROOT = { set_character_flag = faction_demand_@PREV }
			}

			event_target:faction_demanded_title_for = {
				ROOT = { set_character_flag = faction_demand_@PREV }
			}
		}

		# Invite all other vassals to join the coming civil war
		custom_tooltip = {
			text = INVITE_TO_JOIN_CIVIL_WAR

			liege = {
				any_vassal = {
					limit = {
						is_playable = yes
						pf_root_faction_backer_trigger = no
					}

					letter_event = { id = PlusFaction.415 }
				}
			}
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				set_character_flag = civil_war_faction_member

				character_event = {
					id = PlusFaction.462 # civil_war_faction_leader flag removal
					days = 1
				}

				character_event = { id = PlusFaction.341 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_331 # Vote failed

		trigger = {
			check_variable = {
				which = faction_votes
				value < 0
			}
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.342 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		hidden_tooltip = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}

		pf_clear_demands_flags_effect = yes
	}
}

# Faction member notified of "yes" vote
character_event = {
	id = PlusFaction.341
	desc = EVTDESC_PlusFaction_341
	picture = GFX_evt_council

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
					COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
					DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
					KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
				}
			}

			liege = {
				show_scope_change = no

				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
				}
			}
		}
	}
}

# Faction member notified of "no" vote
character_event = {
	id = PlusFaction.342
	desc = EVTDESC_PlusFaction_342
	picture = GFX_evt_council

	is_triggered_only = yes

	option = {
		name = OK

		tooltip = {
			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
					COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
					DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
					KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
				}
			}

			liege = {
				show_scope_change = no

				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
				}
			}
		}

		if = {
			limit = { ai = yes }

			random_list = {
				50 = {
					trigger = {
						opinion = {
							who = FROM
							value >= 0
						}
					}

					# No effect
				}

				50 = {
					opinion = {
						name = upset_faction_decision
						who = FROM
						years = 10
					}
				}

				50 = {
					trigger = {
						opinion = {
							who = FROM
							value < 0
						}
					}

					mult_modifier = {
						factor = 2
						opinion = { who = FROM value < -25 }
					}

					mult_modifier = {
						factor = 2
						opinion = { who = FROM value < -50 }
					}

					opinion = {
						name = upset_faction_decision
						who = FROM
						years = 10
						multiplier = 2
					}
				}
			}
		}
	}
}

# Faction member votes on whether to overthrow the liege
character_event = {
	id = PlusFaction.343
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_343A

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_343 # Vote yes

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_effect = yes }

			opinion = {
				name = opinion_supported_in_meeting
				who = ROOT
				years = 3
			}
		}

		ai_chance = {
			factor = 75

			mult_modifier = {
				factor = 0.5

				has_opinion_modifier = {
					name = sworn_to_support_heir
					who = liege
				}

				NOT = { trait = deceitful }
			}

			mult_modifier = {
				factor = 0.1
				liege = { is_primary_war_defender = yes }
			}

			mult_modifier = {
				factor = 0.1

				FROM = {
					trigger_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power < 0.75 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_prosperity }
						faction_power = { faction = faction_prosperity power < 0.75 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_glory }
						faction_power = { faction = faction_glory power < 0.75 }
					}
					trigger_else = {
						leads_faction = faction_tradition
						faction_power = { faction = faction_tradition power < 0.75 }
					}
				}
			}

			mult_modifier = {
				factor = 1.5

				FROM = {
					trigger_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power >= 2 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_prosperity }
						faction_power = { faction = faction_prosperity power >= 2 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_glory }
						faction_power = { faction = faction_glory power >= 2 }
					}
					trigger_else = {
						leads_faction = faction_tradition
						faction_power = { faction = faction_tradition power >= 2 }
					}
				}
			}

			mult_modifier = {
				factor = 2

				FROM = {
					trigger_if = {
						limit = { leads_faction = faction_court }
						faction_power = { faction = faction_court power >= 3 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_prosperity }
						faction_power = { faction = faction_prosperity power >= 3 }
					}
					trigger_else_if = {
						limit = { leads_faction = faction_glory }
						faction_power = { faction = faction_glory power >= 3 }
					}
					trigger_else = {
						leads_faction = faction_tradition
						faction_power = { faction = faction_tradition power >= 3 }
					}
				}
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 10 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 20 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 30 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 40 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 50 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 60 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 70 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 80 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value >= 90 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < 0 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value < -90 }
			}

			mult_modifier = {
				factor = 1.5
				trait = brave
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 1.25
				trait = wroth
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_343 # Vote no

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_against_effect = yes }

			opinion = {
				name = opinion_opposed_in_meeting
				who = ROOT
				years = 3
			}
		}

		if = {
			limit = { ai = yes }

			opinion = {
				name = upset_faction_decision
				who = FROM
				years = 10
				multiplier = 2
			}
		}

		ai_chance = {
			factor = 25

			mult_modifier = {
				factor = 3.0
				FROM = { NOT = { has_character_flag = faction_is_angry } }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < 0 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -10 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -20 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -30 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -40 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -50 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -60 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -70 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -80 }
			}

			mult_modifier = {
				factor = 0.9
				opinion = { who = liege value < -90 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 10 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 20 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 30 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 40 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 50 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 60 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 70 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 80 }
			}

			mult_modifier = {
				factor = 0.95
				opinion = { who = FROM value >= 90 }
			}

			mult_modifier = {
				factor = 1.5
				trait = craven
			}

			mult_modifier = {
				factor = 1.25
				trait = content
			}

			mult_modifier = {
				factor = 1.25
				trait = humble
			}

			mult_modifier = {
				factor = 1.25
				trait = patient
			}
		}
	}
}

# Results of vote on whether to go to war
character_event = {
	id = PlusFaction.344
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_344

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no
		NOT = { has_character_flag = former_faction_leader }
	}

	option = {
		name = EVTOPTA_PlusFaction_344 # We go to war!

		trigger = {
			check_variable = {
				which = faction_votes
				value >= 0
			}
		}

		set_character_flag = civil_war_faction_leader

		character_event = {
			id = PlusFaction.461 # civil_war_faction_leader flag removal
			days = 1
		}

		character_event = {
			id = PlusFaction.417 # Follow-up event to present ultimatum
			days = 7
		}

		# Invite all other vassals to join the coming civil war
		custom_tooltip = {
			text = INVITE_TO_JOIN_CIVIL_WAR

			liege = {
				any_vassal = {
					limit = {
						is_playable = yes
						pf_root_faction_backer_trigger = no
					}

					letter_event = { id = PlusFaction.415 }
				}
			}
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.345 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_344 # Vote failed and I was removed from power

		trigger = {
			check_variable = {
				which = faction_votes
				value < 0
			}
		}

		custom_tooltip = { text = CUSTOMTOOLTIP45 }
		set_character_flag = former_faction_leader
		set_character_flag = removed_from_leadership

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.346 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}

			pf_clear_demands_flags_effect = yes
		}
	}
}

# Faction member notified of "yes" vote
character_event = {
	id = PlusFaction.345
	desc = EVTDESC_PlusFaction_345
	picture = GFX_evt_council

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
					COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
					DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
					KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
				}
			}

			liege = {
				show_scope_change = no

				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
				}
			}
		}
	}
}

# Faction member notified of "no" vote
character_event = {
	id = PlusFaction.346
	desc = EVTDESC_PlusFaction_346
	picture = GFX_evt_council

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			FROM = {
				show_scope_change = no

				trigger_switch = {
					on_trigger = real_tier

					BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
					COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
					DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
					KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
				}
			}

			liege = {
				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = PREV
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
				}
			}
		}
	}
}

### FACTION LEADERSHIP CHALLENGE

# Faction members propose a no confidence vote to oust leader
character_event = {
	id = PlusFaction.350
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_350

	is_triggered_only = yes
	hide_from = yes

	has_character_flag = faction_leadership_challenge

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no

		liege = {
			any_vassal = {
				pf_root_faction_backer_trigger = yes
			}
		}
	}

	option = {
		name = EVTOPTA_PlusFaction_350 # Go ahead with the vote

		custom_tooltip = {
			text = CUSTOMTOOLTIP44

			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.351 } # Vote
				}
			}

			trigger_switch = {
				on_trigger = real_tier

				BARON = { change_variable = { which = faction_votes value = -1 } }
				COUNT = { change_variable = { which = faction_votes value = -2 } }
				DUKE  = { change_variable = { which = faction_votes value = -4 } }
				KING  = { change_variable = { which = faction_votes value = -8 } }
			}
		}

		character_event = {
			id = PlusFaction.352
			days = 7
		}

		ai_chance = { factor = 90 }
	}

	option = {
		name = EVTOPTB_PlusFaction_350 # Step down voluntarily

		custom_tooltip = { text = CUSTOMTOOLTIP45 }
		set_character_flag = former_faction_leader
		set_character_flag = removed_from_leadership

		trigger_switch = {
			on_trigger = real_tier

			DUKE = { prestige = -100 }
			KING = { prestige = -200 }
			fallback = { prestige = -50 }
		}

		hidden_effect = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.355 } # Notify
				}
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}

		ai_chance = {
			factor = 10

			trigger = {
				NOR = {
					trait = ambitious
					trait = proud
					trait = wroth
				}
			}

			mult_modifier = {
				factor = 10
				trait = content
			}

			mult_modifier = {
				factor = 5
				trait = humble
			}
		}
	}
}

# Faction members vote on whether to oust leader
character_event = {
	id = PlusFaction.351
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_351

	is_triggered_only = yes

	option = {
		name = EVTOPTA_PlusFaction_351 # Vote yes

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_effect = yes }

			opinion = {
				name = opinion_opposed_in_meeting
				who = ROOT
				years = 10
				multiplier = 2
			}
		}

		ai_chance = {
			factor = 50

			trigger = {
				opinion = {
					who = FROM
					value < 20
				}
			}

			mult_modifier = {
				factor = 0.75
				lower_real_tier_than = FROM
			}

			mult_modifier = {
				factor = 2.0

				has_opinion_modifier = {
					name = upset_faction_decision
					who = FROM
				}
			}

			mult_modifier = {
				factor = 0.5
				opinion = { who = FROM value >= 0 }
			}

			mult_modifier = {
				factor = 0.5
				opinion = { who = FROM value >= 10 }
			}

			mult_modifier = {
				factor = 0.75
				trait = kind
			}

			mult_modifier = {
				factor = 0.75
				trait = patient
			}

			mult_modifier = {
				factor = 0.75
				trait = humble
			}

			mult_modifier = {
				factor = 0.75
				trait = content
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_351 # Vote no

		FROM = {
			show_scope_change = no

			ROOT = { pf_member_vote_against_effect = yes }

			opinion = {
				name = opinion_supported_in_meeting
				who = ROOT
				years = 10
				multiplier = 2
			}
		}

		ai_chance = {
			factor = 50

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

			mult_modifier = {
				factor = 0.75
				higher_real_tier_than = FROM
			}

			mult_modifier = {
				factor = 0.75
				opinion = { who = FROM value < -10 }
			}

			mult_modifier = {
				factor = 0.75
				opinion = { who = FROM value < -20 }
			}

			mult_modifier = {
				factor = 0.5
				opinion = { who = FROM value < -30 }
			}

			mult_modifier = {
				factor = 0.5
				opinion = { who = FROM value < -40 }
			}

			mult_modifier = {
				factor = 0.75
				trait = envious
			}

			mult_modifier = {
				factor = 0.75
				trait = wroth
			}

			mult_modifier = {
				factor = 0.75
				trait = cruel
			}

			mult_modifier = {
				factor = 0.75
				trait = ambitious
			}
		}
	}
}

# Results of no confidence vote
character_event = {
	id = PlusFaction.352
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_352

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no
		NOT = { has_character_flag = former_faction_leader }
	}

	option = {
		name = EVTOPTA_PlusFaction_352 # Vote passes

		trigger = {
			check_variable = {
				which = faction_votes
				value > 0
			}
		}

		custom_tooltip = { text = CUSTOMTOOLTIP45 }
		set_character_flag = former_faction_leader
		set_character_flag = removed_from_leadership

		trigger_switch = {
			on_trigger = real_tier

			DUKE = { prestige = -200 }
			KING = { prestige = -400 }
			fallback = { prestige = -100 }
		}

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.353 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = {
				id = PlusFaction.399 # Clear flags
				days = 1
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_352 # Leadership retained

		trigger = {
			check_variable = {
				which = faction_votes
				value <= 0
			}
		}

		prestige = 50
		custom_tooltip = { text = MEETING_CONTINUES }
		clr_character_flag = faction_leadership_challenge
		set_character_flag = faction_meeting_called

		trigger_switch = {
			on_trigger = real_tier

			BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
			COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
			DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
			KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
		}

		liege = {
			show_scope_change = no

			any_vassal = {
				show_scope_change = no

				limit = { pf_root_faction_backer_trigger = yes }

				character_event = { id = PlusFaction.354 } # Notify

				if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_supported_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
					}
				}
				else_if = {
					limit = {
						reverse_has_opinion_modifier = {
							name = opinion_opposed_in_meeting
							who = ROOT
						}
					}

					trigger_switch = {
						on_trigger = real_tier

						BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
						COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
						DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
						KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
					}
				}
			}
		}

		hidden_effect = {
			set_variable = {
				which = faction_votes
				value = 0
			}

			character_event = { id = PlusFaction.303 days = 5 } # Meeting postponed
			character_event = { id = PlusFaction.304 days = 5 } # Start the meeting
		}
	}
}

# Faction members informed that leader has been ousted
character_event = {
	id = PlusFaction.353
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_353

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			liege = {
				show_scope_change = no

				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					character_event = { id = PlusFaction.353 } # Notify

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = FROM
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = FROM
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
				}
			}
		}
	}
}

# Faction members informed that no confidence vote failed
character_event = {
	id = PlusFaction.354
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_354

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			liege = {
				show_scope_change = no

				any_vassal = {
					show_scope_change = no

					limit = { pf_from_faction_backer_trigger = yes }

					if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_supported_in_meeting
								who = FROM
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP47A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP47B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP47C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP47D } }
						}
					}
					else_if = {
						limit = {
							reverse_has_opinion_modifier = {
								name = opinion_opposed_in_meeting
								who = FROM
							}
						}

						trigger_switch = {
							on_trigger = real_tier

							BARON = { custom_tooltip = { text = CUSTOMTOOLTIP46A } }
							COUNT = { custom_tooltip = { text = CUSTOMTOOLTIP46B } }
							DUKE  = { custom_tooltip = { text = CUSTOMTOOLTIP46C } }
							KING  = { custom_tooltip = { text = CUSTOMTOOLTIP46D } }
						}
					}
				}
			}
		}
	}
}

# Faction members informed that leader stepped down voluntarily
character_event = {
	id = PlusFaction.355
	picture = GFX_evt_council
	desc = EVTDESC_PlusFaction_355

	is_triggered_only = yes

	ai = no

	option = {
		name = OK
	}
}

### MEETING MAINTENANCE EVENT

# End meeting event to clear flags
character_event = {
	id = PlusFaction.399

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		set_character_flag = faction_meeting
		clr_character_flag = can_make_demand
		clr_character_flag = faction_meeting_called
		clr_character_flag = faction_meeting_begun
		clr_character_flag = faction_meeting_postponed
		clr_character_flag = faction_leadership_challenge
		clr_character_flag = faction_is_happy
		clr_character_flag = faction_is_content
		clr_character_flag = faction_is_unhappy
		clr_character_flag = faction_is_angry
		clr_character_flag = made_great_speech
		clr_character_flag = made_good_speech
		clr_character_flag = made_fair_speech
		clr_character_flag = made_poor_speech
		clr_character_flag = made_terrible_speech
		clr_character_flag = liege_opinion_increased
		clr_character_flag = liege_opinion_slightly_increased
		clr_character_flag = liege_opinion_slightly_decreased
		clr_character_flag = liege_opinion_decreased
		clr_character_flag = demand_money_liege
		clr_character_flag = demand_support_liege
	}
}