
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
	
	only_playable = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	
	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 }
	}

	trigger = {
		pf_leader_trigger = yes
		pf_war_trait_trigger = no
		
		#there is no pending civil war
		pf_pending_civil_war_trigger = no
		
		OR = {
			#has not postponed a meeting
			NOT = { has_character_flag = faction_meeting_postponed }
			
			#it's been two years since the meeting was postponed
			had_character_flag = { flag = faction_meeting_postponed days = 730 }
			
			#it's been a year since the meeting was postponed and the faction is angry
			AND = {
				had_character_flag = { flag = faction_meeting_postponed days = 365 }
				NOT = { liege = { any_war = { defender = { character = PREVPREV } } } }
				pf_my_faction_angry_trigger = yes
			}
		}
		
		OR = {
			#hasn't held a meeting yet
			NOT = { has_character_flag = faction_meeting }
			
			#it's been three years since the last meeting
			had_character_flag = { flag = faction_meeting days = 1095 }
			
			#it's been two years since the last meeting and the faction is angry
			AND = {
				had_character_flag = { flag = faction_meeting days = 730 }
				NOT = { liege = { any_war = { defender = { character = PREVPREV } } } }
				pf_my_faction_angry_trigger = yes
			}
		}
		
		#there's more than one faction member other than the leader
		liege = { any_vassal = { pf_root_faction_backer_trigger = yes } }
		
		e_placeholder = { had_title_flag = { flag = startup days = 730 } }
		NOT = { has_character_flag = faction_meeting_called }
		NOT = { has_character_flag = faction_leadership_challenge }
	}

	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 0.05
			OR = {
				has_character_flag = faction_meeting_postponed
				had_character_flag = { flag = faction_meeting days = 1825 }
			}
		}
		modifier = {
			factor = 5
			liege = { any_war = { defender = { character = PREVPREV } } }
		}
		modifier = {
			factor = 0.1
			NOT = { liege = { any_war = { defender = { character = PREVPREV } } } }
			pf_my_faction_angry_trigger = yes
		}
	}

	option = {
		name = EVTOPTA_PlusFaction_300 #Send out the invitations
		ai_chance = {
			factor = 90
		}

		#reset the voting and delay variables
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
			set_variable = { which = "faction_meeting_delay" value = 0 }
		}

		set_character_flag = faction_meeting_called
		if = {
			limit = { leads_faction = faction_court }
			custom_tooltip = { text = CUSTOMTOOLTIP51 }
		}
		if = {
			limit = { leads_faction = faction_prosperity }
			custom_tooltip = { text = CUSTOMTOOLTIP52 }
		}
		if = {
			limit = { leads_faction = faction_glory }
			custom_tooltip = { text = CUSTOMTOOLTIP53 }
		}
		if = {
			limit = { leads_faction = 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_tooltip = {
			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
	}
	option = {
		name = EVTOPTB_PlusFaction_300 #It can wait
		ai_chance = {
			factor = 10
			modifier = {
				factor = 100
				war = yes
			}
			modifier = {
				factor = 100
				is_inaccessible_trigger = yes
			}
			modifier = {
				factor = 0.1
				check_variable = { which = "faction_meeting_delay" value = 0.5 }
			}
			modifier = {
				factor = 0.1
				check_variable = { which = "faction_meeting_delay" value = 1.5 }
			}
			modifier = {
				factor = 0.1
				check_variable = { which = "faction_meeting_delay" value = 2.5 }
			}
			modifier = {
				factor = 0.1
				check_variable = { which = "faction_meeting_delay" value = 3.5 }
			}
		}
		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 has been
		if = {
			limit = {
				check_variable = { which = "faction_meeting_delay" value = 0.5 }
				NOT = { check_variable = { which = "faction_meeting_delay" value = 1.5 } }
			}
			random = {
				chance = 33
				character_event = { id = PlusFaction.301 tooltip = CUSTOMTOOLTIP45 }
			}
		}
		if = {
			limit = {
				check_variable = { which = "faction_meeting_delay" value = 1.5 }
				NOT = { check_variable = { which = "faction_meeting_delay" value = 2.5 } }
			}
			random = {
				chance = 50
				character_event = { id = PlusFaction.301 tooltip = CUSTOMTOOLTIP45 }
			}
		}
		if = {
			limit = {
				check_variable = { which = "faction_meeting_delay" value = 2.5 }
				NOT = { check_variable = { which = "faction_meeting_delay" value = 3.5 } }
			}
			random = {
				chance = 75
				character_event = { id = PlusFaction.301 tooltip = CUSTOMTOOLTIP45 }
			}
		}
		if = {
			limit = {
				check_variable = { which = "faction_meeting_delay" value = 3.5 }
			}
			character_event = { id = PlusFaction.301 tooltip = CUSTOMTOOLTIP45 }
		}
		hidden_tooltip = { 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 = {
		hidden_tooltip = {
			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 }
		if = {
			limit = { real_tier = baron }
			prestige = -50
		}
		if = {
			limit = { real_tier = count }
			prestige = -100
		}
		if = {
			limit = { real_tier = duke }
			prestige = -200
		}
		if = {
			limit = { real_tier = 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
			modifier = {
				factor = 0.75
				FROM = { NOT = { diplomacy = 8 } }
			}
			modifier = {
				factor = 0.75
				FROM = { NOT = { diplomacy = 4 } }
			}
			modifier = {
				factor = 1.25
				trait = diligent
			}
			modifier = {
				factor = 1.25
				trait = wroth
			}
			modifier = {
				factor = 1.25
				trait = cruel
			}
			modifier = {
				factor = 1.5
				trait = proud
			}
			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
			modifier = {
				factor = 0
				opinion = { who = FROM value = 0 }
			}
			modifier = {
				factor = 0.5
				opinion = { who = FROM value = -25 }
			}
			modifier = {
				factor = 0.75
				FROM = { diplomacy = 12 }
			}
			modifier = {
				factor = 0.75
				FROM = { diplomacy = 14 }
			}
			modifier = {
				factor = 0.75
				FROM = { diplomacy = 16 }
			}
			modifier = {
				factor = 0.75
				FROM = { diplomacy = 18 }
			}
			modifier = {
				factor = 0.75
				FROM = { diplomacy = 20 }
			}
			modifier = {
				factor = 1.5
				higher_tier_than = FROM
			}
			modifier = {
				factor = 2.0
				has_opinion_modifier = { who = FROM modifier = upset_faction_decision }
			}
			modifier = {
				factor = 0.5
				NOT = { has_opinion_modifier = { who = FROM modifier = upset_faction_decision } }
			}
			modifier = {
				factor = 0.75
				trait = slothful
			}
			modifier = {
				factor = 0.75
				trait = patient
			}
			modifier = {
				factor = 0.75
				trait = shy
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			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
			NOT = {
				liege = {
					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 }
		hidden_tooltip = {
			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 }
	}
	
	hide_from = yes
	is_triggered_only = 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 = {
				leads_faction = faction_court
				liege = {
					OR = {
						independent = yes
						AND = {
							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}
					}
					OR = {
						AND = {
							is_tribal = no
							any_demesne_title = {
								higher_tier_than = duke
								OR = {
									has_law = crown_authority_1
									has_law = crown_authority_2
									has_law = crown_authority_3
									has_law = crown_authority_4
								}
							}
						}
						AND = {
							is_tribal = yes
							independent = yes
							primary_title = {
								OR = {
									has_law = tribal_organization_1
									has_law = tribal_organization_2
									has_law = tribal_organization_3
									has_law = tribal_organization_4
								}
							}
						}
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							is_feudal = yes
							location = { is_capital = no }
						}
						primary_title = {
							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
								AND = {
									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
									}
								}
							}
						}
					}
				}
			}
			set_character_flag = can_make_demand
		}
		if = {
			limit = {
				leads_faction = faction_prosperity
				liege = {
					OR = {
						independent = yes
						AND = {
							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}
					}
					OR = {
						AND = {
							wealth = 100
							NOT = { has_character_flag = loan_taken }
							NOT = { has_character_modifier = ai_austerity }
						}
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							is_feudal = yes
							location = { is_capital = no }
						}
						primary_title = {
							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
								AND = {
									ROOT = { is_tribal = yes }
									has_law = tribal_obligations_4
								}
							}
						}
					}
				}
			}
			set_character_flag = can_make_demand
		}
		if = {
			limit = {
				leads_faction = faction_glory
				liege = {
					OR = {
						independent = yes
						AND = {
							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}
					}
					OR = {
						AND = {
							is_tribal = no
							any_demesne_title = {
								higher_tier_than = duke
								OR = {
									has_law = crown_authority_1
									has_law = crown_authority_2
									has_law = crown_authority_3
									has_law = crown_authority_4
								}
							}
						}
						AND = {
							is_tribal = yes
							independent = yes
							primary_title = {
								OR = {
									has_law = tribal_organization_1
									has_law = tribal_organization_2
									has_law = tribal_organization_3
									has_law = tribal_organization_4
								}
							}
						}
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							is_feudal = yes
							location = { is_capital = no }
						}
						primary_title = {
							OR = {
								has_law = feudal_obligations_3
								has_law = feudal_obligations_4
								has_law = iqta_obligations_3
								has_law = iqta_obligations_4
								AND = {
									ROOT = { is_tribal = yes }
									OR = {
										has_law = tribal_obligations_3
										has_law = tribal_obligations_4
									}
								}
							}
						}
					}
				}
			}
			set_character_flag = can_make_demand
		}
		if = {
			limit = {
				leads_faction = faction_tradition
				liege = {
					OR = {
						independent = yes
						AND = {
							will_liege_enforce_peace = no
							has_liege_enforced_peace = no
						}
					}
					OR = {
						AND = {
							is_tribal = no
							any_demesne_title = {
								higher_tier_than = duke
								OR = {
									has_law = crown_authority_1
									has_law = crown_authority_2
									has_law = crown_authority_3
									has_law = crown_authority_4
								}
							}
						}
						AND = {
							is_tribal = yes
							independent = yes
							primary_title = {
								OR = {
									has_law = tribal_organization_1
									has_law = tribal_organization_2
									has_law = tribal_organization_3
									has_law = tribal_organization_4
								}
							}
						}
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							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_tanistry
								has_title_flag = former_ultimogeniture
								has_title_flag = former_cognatic_succession
								has_title_flag = former_agnatic_succession
								has_title_flag = former_true_cognatic_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
		if = {
			limit = {
				liege = {
					any_demesne_title = {
						can_be_given_away = yes
						tier = count
						location = { is_capital = no }
					}
				}
			}
			# first pick a faction member with a strong claim to the title
			if = {
				limit = {
					liege = {
						NOT = { has_character_flag = found_title }
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							location = { is_capital = no }
							any_claimant = {
								has_strong_claim = PREV
								vassal_of = PREVPREV
								OR = {
									pf_root_faction_backer_trigger = yes
									character = ROOT
								}
							}
						}
					}
				}
				liege = {
					random_demesne_title = {
						limit = {
							can_be_given_away = yes
							tier = count
							location = { is_capital = no }
							any_claimant = {
								has_strong_claim = PREV
								vassal_of = PREVPREV
								OR = {
									pf_root_faction_backer_trigger = yes
									character = ROOT
								}
							}
						}
						save_event_target_as = faction_demanded_title
					}
					random_vassal = {
						limit = {
							has_strong_claim = event_target:faction_demanded_title
							OR = {
								pf_root_faction_backer_trigger = yes
								character = ROOT
							}
						}
						save_event_target_as = faction_demanded_title_for
					}
					set_character_flag = found_title
				}
			}
			# then pick a faction member with ANY claim to the title
			if = {
				limit = {
					liege = {
						NOT = { has_character_flag = found_title }
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							location = { is_capital = no }
							any_claimant = {
								vassal_of = PREVPREV
								OR = {
									pf_root_faction_backer_trigger = yes
									character = ROOT
								}
							}
						}
					}
				}
				liege = {
					random_demesne_title = {
						limit = {
							can_be_given_away = yes
							tier = count
							location = { is_capital = no }
							any_claimant = {
								vassal_of = PREVPREV
								OR = {
									pf_root_faction_backer_trigger = yes
									character = ROOT
								}
							}
						}
						save_event_target_as = faction_demanded_title
					}
					random_vassal = {
						limit = {
							has_claim = event_target:faction_demanded_title
							OR = {
								pf_root_faction_backer_trigger = yes
								character = ROOT
							}
						}
						save_event_target_as = faction_demanded_title_for
					}
					set_character_flag = found_title
				}
			}
			# then pick a de jure liege
			if = {
				limit = {
					liege = {
						NOT = { has_character_flag = found_title }
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							location = { is_capital = no }
							dejure_liege_title = {
								holder_scope = {
									vassal_of = PREVPREVPREV
									OR = {
										pf_root_faction_backer_trigger = yes
										character = ROOT
									}
								}
							}
						}
					}
				}
				liege = {
					random_demesne_title = {
						limit = {
							can_be_given_away = yes
							tier = count
							location = { is_capital = no }
							dejure_liege_title = {
								holder_scope = {
									vassal_of = PREVPREVPREV
									OR = {
										pf_root_faction_backer_trigger = yes
										character = ROOT
									}
								}
							}
						}
						save_event_target_as = faction_demanded_title
						dejure_liege_title = {
							holder_scope = {
								save_event_target_as = faction_demanded_title_for
							}
						}
					}
					set_character_flag = found_title
				}
			}
			# then pick anyone with a neighboring province
			if = {
				limit = {
					liege = {
						NOT = { has_character_flag = found_title }
						any_demesne_title = {
							can_be_given_away = yes
							tier = count
							location = {
								is_capital = no
								any_neighbor_province = {
									owner = {
										vassal_of = PREVPREVPREVPREV
										OR = {
											pf_root_faction_backer_trigger = yes
											character = ROOT
										}
									}
								}
							}
						}
					}
				}
				liege = {
					random_demesne_title = {
						limit = {
							can_be_given_away = yes
							tier = count
							location = {
								is_capital = no
								any_neighbor_province = {
									owner = {
										vassal_of = PREVPREVPREVPREV
										OR = {
											pf_root_faction_backer_trigger = yes
											character = ROOT
										}
									}
								}
							}
						}
						save_event_target_as = faction_demanded_title
						location = {
							random_neighbor_province = {
								limit = {
									owner = {
										vassal_of = PREVPREVPREVPREV
										OR = {
											pf_root_faction_backer_trigger = yes
											character = ROOT
										}
									}
								}
								owner = { save_event_target_as = faction_demanded_title_for }
							}
						}
					}
					set_character_flag = found_title
				}
			}
			# then pick anyone of count+ tier
			if = {
				limit = {
					liege = { NOT = { has_character_flag = found_title } }
				}
				liege = {
					random_demesne_title = {
						limit = {
							can_be_given_away = yes
							tier = count
							location = { is_capital = no }
						}
						save_event_target_as = faction_demanded_title
					}
					random_vassal = {
						limit = {
							higher_tier_than = BARON
							OR = {
								pf_root_faction_backer_trigger = yes
								character = ROOT
							}
						}
						save_event_target_as = faction_demanded_title_for
					}
				}
			}
			liege = { clr_character_flag = found_title }
		}

		#now set the leader's faction mood
		if = {
			limit = { leads_faction = faction_court }
			if = {
				limit = { liege = { has_character_flag = faction_court_happy } }
				set_character_flag = faction_is_happy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_court_unhappy } }
				set_character_flag = faction_is_unhappy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_court_angry } }
				set_character_flag = faction_is_angry
				break = yes
			}
			set_character_flag = faction_is_content
			break = yes
		}
		if = {
			limit = { leads_faction = faction_prosperity }
			if = {
				limit = { liege = { has_character_flag = faction_prosperity_happy } }
				set_character_flag = faction_is_happy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_prosperity_unhappy } }
				set_character_flag = faction_is_unhappy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_prosperity_angry } }
				set_character_flag = faction_is_angry
				break = yes
			}
			set_character_flag = faction_is_content
			break = yes
		}
		if = {
			limit = { leads_faction = faction_glory }
			if = {
				limit = { liege = { has_character_flag = faction_glory_happy } }
				set_character_flag = faction_is_happy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_glory_unhappy } }
				set_character_flag = faction_is_unhappy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_glory_angry } }
				set_character_flag = faction_is_angry
				break = yes
			}
			set_character_flag = faction_is_content
			break = yes
		}
		if = {
			limit = { leads_faction = faction_tradition }
			if = {
				limit = { liege = { has_character_flag = faction_tradition_happy } }
				set_character_flag = faction_is_happy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_tradition_unhappy } }
				set_character_flag = faction_is_unhappy
				break = yes
			}
			if = {
				limit = { liege = { has_character_flag = faction_tradition_angry } }
				set_character_flag = faction_is_angry
				break = yes
			}
			set_character_flag = faction_is_content
			break = yes
		}
	}
	
	option = {
		name = EVTOPTA_PlusFaction_304 #I will strengthen my position within the faction
		trigger = {
			NOT = { has_character_flag = faction_is_angry }
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_unhappy
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 1.25
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = envious
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 0.75
				trait = humble
			}
			modifier = {
				factor = 0.75
				trait = content
			}
			modifier = {
				factor = 0.75
				trait = charitable
			}
			modifier = {
				factor = 0.5
				NOT = {
					liege = {
						any_vassal = {
							pf_root_faction_backer_trigger = yes
							NOT = { opinion = { who = ROOT value = -25 } }
						}
					}
				}
			}
			modifier = {
				factor = 0
				NOT = {
					liege = {
						any_vassal = {
							pf_root_faction_backer_trigger = yes
							NOT = { opinion = { who = ROOT value = 0 } }
						}
					}
				}
			}
		}
		character_event = { id = PlusFaction.310 tooltip = EVTTOOLTIP1900600 }
	}
	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
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				OR = {
					trait = stutter
					NOT = { diplomacy = 8 }
				}
			}
			modifier = {
				factor = 1.25
				trait = kind
			}
			modifier = {
				factor = 1.25
				trait = humble
			}
			modifier = {
				factor = 1.25
				trait = content
			}
			modifier = {
				factor = 0.75
				trait = ambitious
			}
			modifier = {
				factor = 0.75
				trait = proud
			}
			modifier = {
				factor = 0.75
				trait = envious
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 75 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 25 }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = liege value = 0 } }
			}
			modifier = {
				factor = 0.25
				NOT = { opinion = { who = liege value = -25 } }
			}
			modifier = {
				factor = 0
				NOT = { opinion = { who = liege value = -50 } }
			}
		}
		character_event = { id = PlusFaction.313 tooltip = EVTTOOLTIP1900601 } #strengthen liege
	}
	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
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.75
				trait = kind
			}
			modifier = {
				factor = 0.75
				trait = humble
			}
			modifier = {
				factor = 0.75
				trait = content
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 1.25
				trait = envious
			}
			modifier = {
				factor = 0
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 0.25
				opinion = { who = liege value = 25 }
			}
			modifier = {
				factor = 0.5
				opinion = { who = liege value = 0 }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = liege value = 0 } }
			}
			modifier = {
				factor = 1.5
				NOT = { opinion = { who = liege value = -25 } }
			}
			modifier = {
				factor = 2.0
				NOT = { opinion = { who = liege value = -50 } }
			}
			modifier = {
				factor = 2.0
				NOT = { opinion = { who = liege value = -75 } }
			}
		}
		character_event = { id = PlusFaction.317 tooltip = EVTTOOLTIP1900602 } #weaken liege
	}
	option = {
		name = EVTOPTD_PlusFaction_304 #Pass the time
		trigger = {
			OR = {
				has_character_flag = faction_is_happy
				has_character_flag = faction_is_content
			}
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				has_character_flag = faction_is_happy
			}
			modifier = {
				factor = 5
				trait = slothful
			}
			modifier = {
				factor = 0.1
				OR = {
					trait = ambitious
					trait = diligent
				}
			}
		}
		custom_tooltip = { text = CUSTOMTOOLTIP56 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.306 }
				}
			}
		}
	}
	option = {
		name = EVTOPTE_PlusFaction_304 #Our liege must step down
		trigger = {
			has_character_flag = faction_is_angry
			OR = {
				has_opinion_modifier = { who = liege modifier = ultimatum_refused }
				NOT = { has_character_flag = can_make_demand }
			}
			liege = {
				OR = {
					independent = yes
					AND = {
						will_liege_enforce_peace = no
						has_liege_enforced_peace = no
					}
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.01
				liege = { any_war = { defender = { character = PREVPREV } } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_court
				NOT = { faction_power = { faction = faction_court power = 0.75 } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_prosperity
				NOT = { faction_power = { faction = faction_prosperity power = 0.75 } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_glory
				NOT = { faction_power = { faction = faction_glory power = 0.75 } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_tradition
				NOT = { faction_power = { faction = faction_tradition power = 0.75 } }
			}
			modifier = {
				factor = 1.5
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.49 }
			}
			modifier = {
				factor = 1.5
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.49 }
			}
			modifier = {
				factor = 1.5
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.49 }
			}
			modifier = {
				factor = 1.5
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.49 }
			}
			modifier = {
				factor = 3.0
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.99 }
			}
			modifier = {
				factor = 3.0
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.99 }
			}
			modifier = {
				factor = 3.0
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.99 }
			}
			modifier = {
				factor = 3.0
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.99 }
			}
			modifier = {
				factor = 5.0
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 2.99 }
			}
			modifier = {
				factor = 5.0
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 2.99 }
			}
			modifier = {
				factor = 5.0
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 2.99 }
			}
			modifier = {
				factor = 5.0
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 2.99 }
			}
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.5
				trait = craven
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.343 } #vote
				}
			}
		}
		hidden_tooltip = {
			if = {
				limit = { real_tier = BARON }
				change_variable = { which = "faction_votes" value = 1 }
			}
			if = {
				limit = { real_tier = COUNT }
				change_variable = { which = "faction_votes" value = 2 }
			}
			if = {
				limit = { real_tier = DUKE }
				change_variable = { which = "faction_votes" value = 4 }
			}
			if = {
				limit = { real_tier = KING }
				change_variable = { which = "faction_votes" value = 8 }
			}
		}
		character_event = { id = PlusFaction.344 days = 7 tooltip = EVTTOOLTIP1900737 }
	}
	option = {
		name = EVTOPTF_PlusFaction_304 #We should present our demands
		trigger = {
			OR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
			NOT = { has_opinion_modifier = { who = liege modifier = ultimatum_refused } }
			has_character_flag = can_make_demand
		}
		ai_chance = {
			factor = 150
			modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
			modifier = {
				factor = 0.01
				liege = { any_war = { defender = { character = PREVPREV } } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_court
				NOT = { faction_power = { faction = faction_court power = 0.75 } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_prosperity
				NOT = { faction_power = { faction = faction_prosperity power = 0.75 } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_glory
				NOT = { faction_power = { faction = faction_glory power = 0.75 } }
			}
			modifier = {
				factor = 0
				leads_faction = faction_tradition
				NOT = { faction_power = { faction = faction_tradition power = 0.75 } }
			}
			modifier = {
				factor = 2.0
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.49 }
			}
			modifier = {
				factor = 2.0
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.49 }
			}
			modifier = {
				factor = 2.0
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.49 }
			}
			modifier = {
				factor = 2.0
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.49 }
			}
			modifier = {
				factor = 4.0
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.99 }
			}
			modifier = {
				factor = 4.0
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.99 }
			}
			modifier = {
				factor = 4.0
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.99 }
			}
			modifier = {
				factor = 4.0
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.99 }
			}
			modifier = {
				factor = 6.0
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 2.99 }
			}
			modifier = {
				factor = 6.0
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 2.99 }
			}
			modifier = {
				factor = 6.0
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 2.99 }
			}
			modifier = {
				factor = 6.0
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 2.99 }
			}
			modifier = {
				factor = 2
				trait = craven
			}
			modifier = {
				factor = 0.5
				trait = brave
			}
		}
		if = {
			limit = { leads_faction = faction_court }
			character_event = { id = PlusFaction.321 tooltip = EVTTOOLTIP1900604 } #make a demand of liege
		}
		if = {
			limit = { leads_faction = faction_prosperity }
			character_event = { id = PlusFaction.322 tooltip = EVTTOOLTIP1900604 } #make a demand of liege
		}
		if = {
			limit = { leads_faction = faction_glory }
			character_event = { id = PlusFaction.323 tooltip = EVTTOOLTIP1900604 } #make a demand of liege
		}
		if = {
			limit = { leads_faction = faction_tradition }
			character_event = { id = PlusFaction.324 tooltip = EVTTOOLTIP1900604 } #make a demand of liege
		}
	}
	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
			}
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
			}
			modifier = {
				factor = 1.25
				trait = kind
			}
			modifier = {
				factor = 1.25
				trait = humble
			}
			modifier = {
				factor = 1.25
				trait = content
			}
			modifier = {
				factor = 0.75
				trait = ambitious
			}
			modifier = {
				factor = 0.75
				trait = proud
			}
			modifier = {
				factor = 0.75
				trait = envious
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 75 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 25 }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = liege value = 0 } }
			}
			modifier = {
				factor = 0
				NOT = { opinion = { who = liege value = -25 } }
			}
		}
		character_event = { id = PlusFaction.313 tooltip = EVTTOOLTIP1900601 } #strengthen liege
	}
	option = {
		name = EVTOPTH_PlusFaction_304 #We will discuss our complaints in detail
		trigger = {
			has_character_flag = faction_is_unhappy
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.75
				trait = kind
			}
			modifier = {
				factor = 0.75
				trait = humble
			}
			modifier = {
				factor = 0.75
				trait = content
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 1.25
				trait = envious
			}
			modifier = {
				factor = 0
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 0.5
				opinion = { who = liege value = 25 }
			}
			modifier = {
				factor = 0.5
				opinion = { who = liege value = 0 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.49 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.49 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.49 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.49 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.99 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.99 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.99 }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.99 }
			}
		}
		character_event = { id = PlusFaction.317 tooltip = EVTTOOLTIP1900602 } #weaken liege
	}
	option = {
		name = EVTOPTI_PlusFaction_304 #We are not yet strong enough to act
		trigger = {
			has_character_flag = faction_is_angry
			liege = {
				NOR = {
					any_war = { defender = { character = PREVPREV } }
					AND = {
						independent = no
						OR = {
							will_liege_enforce_peace = yes
							has_liege_enforced_peace = yes
						}
					}
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.49 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.49 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.49 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 0.5
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.49 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 0.1
				leads_faction = faction_court
				faction_power = { faction = faction_court power = 1.99 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 0.1
				leads_faction = faction_prosperity
				faction_power = { faction = faction_prosperity power = 1.99 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 0.1
				leads_faction = faction_glory
				faction_power = { faction = faction_glory power = 1.99 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 0.1
				leads_faction = faction_tradition
				faction_power = { faction = faction_tradition power = 1.99 }
				NOT = { opinion = { who = liege value = 25 } }
			}
			modifier = {
				factor = 2
				trait = craven
			}
			modifier = {
				factor = 0.5
				trait = brave
			}
			modifier = {
				factor = 2.0
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 2.0
				opinion = { who = liege value = 75 }
			}
		}
		custom_tooltip = { text = CUSTOMTOOLTIP57 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.305 }
				}
			}
		}
	}
	option = {
		name = EVTOPTJ_PlusFaction_304 #Now is not the time to act
		trigger = {
			has_character_flag = faction_is_angry
			liege = {
				OR = {
					any_war = { defender = { character = PREVPREV } }
					AND = {
						independent = no
						OR = {
							will_liege_enforce_peace = yes
							has_liege_enforced_peace = yes
						}
					}
				}
			}
		}
		ai_chance = {
			factor = 100
		}
		custom_tooltip = { text = CUSTOMTOOLTIP59 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.305 }
				}
			}
		}
	}
}

# 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 = {
			FROM = { NOT = { has_character_flag = faction_demand_refused } }
			liege = { any_war = { defender = { character = PREVPREV } } }
		}
	}
	desc = {
		text = EVTDESC_PlusFaction_305B
		trigger = {
			FROM = { NOT = { has_character_flag = faction_demand_refused } }
			NOT = { liege = { any_war = { defender = { character = PREVPREV } } } }
		}
	}
	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 = { any_war = { defender = { character = PREVPREV } } } }
	}
	option = {
		name = EVTOPTB_PlusFaction_305 #I trust his judgement
		trigger = { NOT = { liege = { any_war = { defender = { character = PREVPREV } } } } }
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = trusting
			}
			modifier = {
				factor = 1.5
				trait = content
			}
			modifier = {
				factor = 1.5
				trait = humble
			}
			modifier = {
				factor = 1.5
				trait = patient
			}
			modifier = {
				factor = 0.75
				trait = proud
			}
			modifier = {
				factor = 0.75
				trait = wroth
			}
			modifier = {
				factor = 0.75
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				trait = paranoid
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -75 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = -25 } }
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 0 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 25 }
			}
			modifier = {
				factor = 2
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 3
				opinion = { who = FROM value = 75 }
			}
		}
	}
	option = {
		name = EVTOPTC_PlusFaction_305 #This is an outrage!
		trigger = { NOT = { liege = { any_war = { defender = { character = PREVPREV } } } } }
		ai_chance = {
			factor = 300
			modifier = {
				factor = 0
				FROM = {
					leads_faction = faction_court
					NOT = { faction_power = { faction = faction_court power = 0.75 } }
				}
			}
			modifier = {
				factor = 0
				FROM = {
					leads_faction = faction_prosperity
					NOT = { faction_power = { faction = faction_prosperity power = 0.75 } }
				}
			}
			modifier = {
				factor = 0
				FROM = {
					leads_faction = faction_glory
					NOT = { faction_power = { faction = faction_glory power = 0.75 } }
				}
			}
			modifier = {
				factor = 0
				FROM = {
					leads_faction = faction_tradition
					NOT = { faction_power = { faction = faction_tradition power = 0.75 } }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_court
					faction_power = { faction = faction_court power = 1.49 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_prosperity
					faction_power = { faction = faction_prosperity power = 1.49 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_glory
					faction_power = { faction = faction_glory power = 1.49 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_tradition
					faction_power = { faction = faction_tradition power = 1.49 }
				}
			}
			modifier = {
				factor = 3.0
				FROM = {
					leads_faction = faction_court
					faction_power = { faction = faction_court power = 1.99 }
				}
			}
			modifier = {
				factor = 3.0
				FROM = {
					leads_faction = faction_prosperity
					faction_power = { faction = faction_prosperity power = 1.99 }
				}
			}
			modifier = {
				factor = 3.0
				FROM = {
					leads_faction = faction_glory
					faction_power = { faction = faction_glory power = 1.99 }
				}
			}
			modifier = {
				factor = 3.0
				FROM = {
					leads_faction = faction_tradition
					faction_power = { faction = faction_tradition power = 1.99 }
				}
			}
			modifier = {
				factor = 5.0
				FROM = {
					leads_faction = faction_court
					faction_power = { faction = faction_court power = 2.99 }
				}
			}
			modifier = {
				factor = 5.0
				FROM = {
					leads_faction = faction_prosperity
					faction_power = { faction = faction_prosperity power = 2.99 }
				}
			}
			modifier = {
				factor = 5.0
				FROM = {
					leads_faction = faction_glory
					faction_power = { faction = faction_glory power = 2.99 }
				}
			}
			modifier = {
				factor = 5.0
				FROM = {
					leads_faction = faction_tradition
					faction_power = { faction = faction_tradition power = 2.99 }
				}
			}
			modifier = {
				factor = 2
				trait = craven
			}
			modifier = {
				factor = 0.5
				trait = brave
			}
		}
		opinion = {
			who = FROM
			modifier = upset_faction_decision
			multiplier = 2
			years = 10
		}
	}
}

# 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
			modifier = {
				factor = 1.5
				trait = trusting
			}
			modifier = {
				factor = 1.25
				trait = patient
			}
			modifier = {
				factor = 1.25
				trait = content
			}
			modifier = {
				factor = 1.25
				trait = humble
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 25 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 75 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 25 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = liege value = 75 }
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_306 #I don't like this
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2.0
				trait = wroth
			}
			modifier = {
				factor = 1.5
				trait = paranoid
			}
			modifier = {
				factor = 2.0
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 1.5
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 1.5
				NOT = { opinion = { who = FROM value = -25 } }
			}
			modifier = {
				factor = 1.5
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 1.5
				NOT = { opinion = { who = FROM value = -75 } }
			}
			modifier = {
				factor = 1.5
				NOT = { opinion = { who = liege value = 0 } }
			}
			modifier = {
				factor = 2.0
				NOT = { opinion = { who = liege value = -25 } }
			}
			modifier = {
				factor = 2.0
				NOT = { opinion = { who = liege value = -50 } }
			}
			modifier = {
				factor = 2.0
				NOT = { opinion = { who = liege value = -75 } }
			}
		}
		opinion = {
			who = FROM
			modifier = upset_faction_decision
			years = 10
		}
	}
}

# 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 = { FROM = { leads_faction = faction_court } }
	}
	desc = {
		text = EVTDESC_PlusFaction_307B
		trigger = { FROM = { leads_faction = faction_prosperity } }
	}
	desc = {
		text = EVTDESC_PlusFaction_307C
		trigger = { FROM = { leads_faction = faction_glory } }
	}
	desc = {
		text = EVTDESC_PlusFaction_307D
		trigger = { FROM = { leads_faction = faction_tradition } }
	}
	
	is_triggered_only = yes

	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
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				trait = stutter
			}
			modifier = {
				factor = 0.5
				NOT = { diplomacy = 8 }
			}
			modifier = {
				factor = 2.0
				trait = proud
			}
			modifier = {
				factor = 0.25
				trait = humble
			}
		}
		random_list = {
			15 = {
				modifier = {
					factor = 0.5
					trait = stutter
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 0.25
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 1.5
					diplomacy = 12
				}
				modifier = {
					factor = 1.5
					diplomacy = 14
				}
				modifier = {
					factor = 1.75
					diplomacy = 16
				}
				modifier = {
					factor = 1.75
					diplomacy = 18
				}
				modifier = {
					factor = 1.75
					diplomacy = 20
				}
				set_character_flag = made_great_speech
				character_event = { id = PlusFaction.311 tooltip = EVTTOOLTIP1900700 } # great speech
			}
			25 = {
				modifier = {
					factor = 0.5
					trait = stutter
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 1.5
					diplomacy = 12
				}
				modifier = {
					factor = 1.5
					diplomacy = 14
				}
				modifier = {
					factor = 1.5
					diplomacy = 16
				}
				modifier = {
					factor = 1.75
					diplomacy = 18
				}
				modifier = {
					factor = 1.75
					diplomacy = 20
				}
				set_character_flag = made_good_speech
				character_event = { id = PlusFaction.311 tooltip = EVTTOOLTIP1900702 } # good speech
			}
			30 = {
				modifier = {
					factor = 0.5
					trait = stutter
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 1.5
					diplomacy = 12
				}
				modifier = {
					factor = 1.5
					diplomacy = 14
				}
				modifier = {
					factor = 1.5
					diplomacy = 16
				}
				modifier = {
					factor = 1.5
					diplomacy = 18
				}
				modifier = {
					factor = 1.75
					diplomacy = 20
				}
				set_character_flag = made_fair_speech
				character_event = { id = PlusFaction.311 tooltip = EVTTOOLTIP1900704 } # fair speech
			}
			20 = {
				modifier = {
					factor = 1.5
					trait = stutter
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 1.75
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 0.75
					diplomacy = 12
				}
				modifier = {
					factor = 0.75
					diplomacy = 14
				}
				modifier = {
					factor = 0.75
					diplomacy = 16
				}
				modifier = {
					factor = 0.75
					diplomacy = 18
				}
				modifier = {
					factor = 0.5
					diplomacy = 20
				}
				set_character_flag = made_bad_speech
				character_event = { id = PlusFaction.311 tooltip = EVTTOOLTIP1900706 } # bad speech
			}
			10 = {
				modifier = {
					factor = 1.5
					trait = stutter
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 1.75
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 1.75
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 0.75
					diplomacy = 12
				}
				modifier = {
					factor = 0.75
					diplomacy = 14
				}
				modifier = {
					factor = 0.75
					diplomacy = 16
				}
				modifier = {
					factor = 0.5
					diplomacy = 18
				}
				modifier = {
					factor = 0.5
					diplomacy = 20
				}
				set_character_flag = made_terrible_speech
				character_event = { id = PlusFaction.311 tooltip = EVTTOOLTIP1900708 } # laughed out of the room
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_310 # request funds for self
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2.0
				trait = greedy
			}
			modifier = {
				factor = 0.25
				trait = charitable
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.335 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.336 days = 7 tooltip = EVTTOOLTIP1900710 }
	}
	option = {
		name = "NEVERMIND"
		ai_chance = { factor = 0 }
		custom_tooltip = { text = CUSTOMTOOLTIP55 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.304 } #Go back to setting agenda
		}
	}
}

# 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 }
		}
		if = {
			limit = { has_character_flag = made_great_speech }
			if = {
				limit = { lower_real_tier_than = duke }
				prestige = 50
			}
			if = {
				limit = { real_tier = duke }
				prestige = 100
			}
			if = {
				limit = { real_tier = king }
				prestige = 200
			}
		}
		if = {
			limit = { has_character_flag = made_good_speech }
			if = {
				limit = { lower_real_tier_than = duke }
				prestige = 25
			}
			if = {
				limit = { real_tier = duke }
				prestige = 50
			}
			if = {
				limit = { real_tier = king }
				prestige = 100
			}
		}
		if = {
			limit = { has_character_flag = made_poor_speech }
			if = {
				limit = { lower_real_tier_than = duke }
				prestige = -25
			}
			if = {
				limit = { real_tier = duke }
				prestige = -50
			}
			if = {
				limit = { real_tier = king }
				prestige = -100
			}
		}
		if = {
			limit = { has_character_flag = made_terrible_speech }
			if = {
				limit = { lower_real_tier_than = duke }
				prestige = -50
			}
			if = {
				limit = { real_tier = duke }
				prestige = -100
			}
			if = {
				limit = { real_tier = king }
				prestige = -200
			}
			custom_tooltip = { text = CUSTOMTOOLTIP45 }
			set_character_flag = former_faction_leader
			set_character_flag = removed_from_leadership
		}
		liege = {
			any_vassal = {
				limit = { pf_root_faction_backer_trigger = yes }
				hidden_tooltip = {
					remove_opinion = { who = ROOT modifier = great_speech }
					remove_opinion = { who = ROOT modifier = good_speech }
					remove_opinion = { who = ROOT modifier = okay_speech }
					remove_opinion = { who = ROOT modifier = bad_speech }
					remove_opinion = { who = ROOT modifier = terrible_speech }
				}
				if = {
					limit = { ROOT = { has_character_flag = made_great_speech } }
					opinion = { who = ROOT modifier = great_speech years = 10 }
				}
				if = {
					limit = { ROOT = { has_character_flag = made_good_speech } }
					opinion = { who = ROOT modifier = good_speech years = 10 }
				}
				if = {
					limit = { ROOT = { has_character_flag = made_fair_speech } }
					opinion = { who = ROOT modifier = okay_speech years = 10 }
				}
				if = {
					limit = { ROOT = { has_character_flag = made_poor_speech } }
					opinion = { who = ROOT modifier = bad_speech years = 10 }
				}
				if = {
					limit = { ROOT = { has_character_flag = made_terrible_speech } }
					opinion = { who = ROOT modifier = terrible_speech years = 10 }
				}
				hidden_tooltip = {
					character_event = { id = PlusFaction.312 } #notify
				}
			}
		}
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
}

# 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
	
	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 } }
		}
		if = {
			limit = { FROM = { has_character_flag = made_great_speech } }
			tooltip = {
				opinion = { who = FROM modifier = great_speech years = 10 }
			}
		}
		if = {
			limit = { FROM = { has_character_flag = made_good_speech } }
			tooltip = {
				opinion = { who = FROM modifier = good_speech years = 10 }
			}
		}
		if = {
			limit = { FROM = { has_character_flag = made_fair_speech } }
			tooltip = {
				opinion = { who = FROM modifier = okay_speech years = 10 }
			}
		}
		if = {
			limit = { FROM = { has_character_flag = made_poor_speech } }
			tooltip = {
				opinion = { who = FROM modifier = bad_speech years = 10 }
			}
		}
		if = {
			limit = { FROM = { has_character_flag = made_terrible_speech } }
			tooltip = {
				opinion = { who = FROM modifier = 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
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				trait = stutter
			}
			modifier = {
				factor = 0.5
				NOT = { diplomacy = 8 }
			}
			modifier = {
				factor = 2.0
				trait = proud
			}
			modifier = {
				factor = 0.25
				trait = humble
			}
		}
		random_list = {
			30 = {
				modifier = {
					factor = 0.5
					has_character_flag = faction_is_angry
				}
				modifier = {
					factor = 0.75
					has_character_flag = faction_is_unhappy
				}
				modifier = {
					factor = 0.75
					trait = stutter
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 1.5
					diplomacy = 12
				}
				modifier = {
					factor = 1.5
					diplomacy = 14
				}
				modifier = {
					factor = 1.5
					diplomacy = 16
				}
				modifier = {
					factor = 1.75
					diplomacy = 18
				}
				modifier = {
					factor = 1.75
					diplomacy = 20
				}
				set_character_flag = liege_opinion_increased
				character_event = { id = PlusFaction.314 tooltip = EVTTOOLTIP1900713 } # faction opinion of liege increased
			}
			40 = {
				modifier = {
					factor = 0.5
					has_character_flag = faction_is_angry
				}
				modifier = {
					factor = 0.75
					has_character_flag = faction_is_unhappy
				}
				modifier = {
					factor = 0.75
					trait = stutter
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 1.5
					diplomacy = 12
				}
				modifier = {
					factor = 1.5
					diplomacy = 14
				}
				modifier = {
					factor = 1.5
					diplomacy = 16
				}
				modifier = {
					factor = 1.5
					diplomacy = 18
				}
				modifier = {
					factor = 1.5
					diplomacy = 20
				}
				set_character_flag = liege_opinion_slightly_increased
				character_event = { id = PlusFaction.314 tooltip = EVTTOOLTIP1900716 } # faction opinion of liege slightly increased
			}
			30 = {
				modifier = {
					factor = 2.0
					has_character_flag = faction_is_angry
				}
				modifier = {
					factor = 1.5
					has_character_flag = faction_is_unhappy
				}
				modifier = {
					factor = 1.5
					trait = stutter
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 0.75
					diplomacy = 12
				}
				modifier = {
					factor = 0.75
					diplomacy = 14
				}
				modifier = {
					factor = 0.75
					diplomacy = 16
				}
				modifier = {
					factor = 0.5
					diplomacy = 18
				}
				modifier = {
					factor = 0.5
					diplomacy = 20
				}
				set_character_flag = liege_opinion_decreased
				character_event = { id = PlusFaction.314 tooltip = EVTTOOLTIP1900719 } # faction opinion of liege decreased
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_313 # request funds for liege
		trigger = {
			NOR = {
				has_character_flag = faction_is_unhappy
				has_character_flag = faction_is_angry
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2.0
				trait = charitable
			}
			modifier = {
				factor = 0.25
				trait = greedy
			}
		}
		set_character_flag = demand_money_liege
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.330 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.331 days = 7 tooltip = EVTTOOLTIP1900722 }
	}
	option = {
		name = EVTOPTC_PlusFaction_313 # encourage a show of support
		trigger = {
			NOT = { has_character_flag = faction_is_angry }
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.1
				has_character_flag = faction_is_unhappy
			}
			modifier = {
				factor = 2.0
				trait = kind
			}
			modifier = {
				factor = 0.25
				trait = envious
			}
		}
		set_character_flag = demand_support_liege
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.330 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.331 days = 7 tooltip = EVTTOOLTIP1900725 }
	}
	option = {
		name = "NEVERMIND"
		ai_chance = { factor = 0 }
		custom_tooltip = { text = CUSTOMTOOLTIP55 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.304 } #go back to setting agenda
		}
	}
}

# 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 = {
				NOT = { has_character_flag = liege_opinion_decreased }
				leads_faction = faction_court
			}
			liege = { custom_tooltip = { text = COURTFACTIONMOODPLUS } }
		}
		if = {
			limit = {
				NOT = { has_character_flag = liege_opinion_decreased }
				leads_faction = faction_prosperity
			}
			liege = { custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS } }
		}
		if = {
			limit = {
				NOT = { has_character_flag = liege_opinion_decreased }
				leads_faction = faction_glory
			}
			liege = { custom_tooltip = { text = GLORYFACTIONMOODPLUS } }
		}
		if = {
			limit = {
				NOT = { has_character_flag = liege_opinion_decreased }
				leads_faction = faction_tradition
			}
			liege = { custom_tooltip = { text = TRADITIONFACTIONMOODPLUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_decreased
				leads_faction = faction_court
			}
			liege = { custom_tooltip = { text = COURTFACTIONMOODMINUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_decreased
				leads_faction = faction_prosperity
			}
			liege = { custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_decreased
				leads_faction = faction_glory
			}
			liege = { custom_tooltip = { text = GLORYFACTIONMOODMINUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_decreased
				leads_faction = faction_tradition
			}
			liege = { custom_tooltip = { text = TRADITIONFACTIONMOODMINUS } }
		}
		hidden_tooltip = {
			liege = {
				reverse_opinion = { who = ROOT modifier = spoke_on_lieges_behalf years = 10 }
				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 days = 1 } #clear flags
		}
	}
}

# 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 } }
			liege = { reverse_opinion = { who = ROOT modifier = convinced_to_support_liege multiplier = 2 years = 10 } }
		}
		if = {
			limit = { FROM = { has_character_flag = liege_opinion_slightly_increased } }
			liege = { reverse_opinion = { who = ROOT modifier = convinced_to_support_liege years = 10 } }
		}
		if = {
			limit = { FROM = { has_character_flag = liege_opinion_decreased } }
			liege = { reverse_opinion = { who = ROOT modifier = turned_against_liege years = 10 } }
			opinion = { who = FROM modifier = upset_faction_decision years = 10 }
		}
		if = {
			limit = {
				FROM = { has_character_flag = faction_is_unhappy }
				NOT = { opinion = { who = liege value = 0 } }
			}
			opinion = { who = FROM modifier = upset_faction_decision years = 10 }
		}
		if = {
			limit = {
				FROM = { has_character_flag = faction_is_angry }
				NOT = { opinion = { who = liege value = 0 } }
			}
			opinion = { who = FROM modifier = upset_faction_decision multiplier = 2 years = 10 }
		}
	}
}

# 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 } }
		}
		if = {
			limit = {
				FROM = {
					NOT = { has_character_flag = liege_opinion_decreased }
					leads_faction = faction_court
				}
			}
			custom_tooltip = { text = COURTFACTIONMOODPLUS }
		}
		if = {
			limit = {
				FROM = {
					NOT = { has_character_flag = liege_opinion_decreased }
					leads_faction = faction_prosperity
				}
			}
			custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS }
		}
		if = {
			limit = {
				FROM = {
					NOT = { has_character_flag = liege_opinion_decreased }
					leads_faction = faction_glory
				}
			}
			custom_tooltip = { text = GLORYFACTIONMOODPLUS }
		}
		if = {
			limit = {
				FROM = {
					NOT = { has_character_flag = liege_opinion_decreased }
					leads_faction = faction_tradition
				}
			}
			custom_tooltip = { text = TRADITIONFACTIONMOODPLUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_decreased
					leads_faction = faction_court
				}
			}
			custom_tooltip = { text = COURTFACTIONMOODMINUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_decreased
					leads_faction = faction_prosperity
				}
			}
			custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_decreased
					leads_faction = faction_glory
				}
			}
			custom_tooltip = { text = GLORYFACTIONMOODMINUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_decreased
					leads_faction = faction_tradition
				}
			}
			custom_tooltip = { text = TRADITIONFACTIONMOODMINUS }
		}
		if = {
			limit = { FROM = { has_character_flag = liege_opinion_increased } }
			opinion = { who = FROM modifier = spoke_on_lieges_behalf multiplier = 2 years = 10 }
		}
		if = {
			limit = { FROM = { has_character_flag = liege_opinion_slightly_increased } }
			opinion = { who = FROM modifier = spoke_on_lieges_behalf years = 10 }
		}
		hidden_tooltip = {
			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
		ai_chance = { factor = 100 }
		random_list = {
			30 = {
				modifier = {
					factor = 0.75
					has_character_flag = faction_is_happy
				}
				modifier = {
					factor = 1.5
					has_character_flag = faction_is_unhappy
				}
				modifier = {
					factor = 0.75
					trait = stutter
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 0.5
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 1.5
					diplomacy = 12
				}
				modifier = {
					factor = 1.5
					diplomacy = 14
				}
				modifier = {
					factor = 1.5
					diplomacy = 16
				}
				modifier = {
					factor = 1.75
					diplomacy = 18
				}
				modifier = {
					factor = 1.75
					diplomacy = 20
				}
				set_character_flag = liege_opinion_decreased
				character_event = { id = PlusFaction.318 tooltip = EVTTOOLTIP1900728 } # faction opinion of liege decreased
			}
			40 = {
				modifier = {
					factor = 0.75
					has_character_flag = faction_is_happy
				}
				modifier = {
					factor = 1.5
					has_character_flag = faction_is_unhappy
				}
				modifier = {
					factor = 0.75
					trait = stutter
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 0.75
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 1.5
					diplomacy = 12
				}
				modifier = {
					factor = 1.5
					diplomacy = 14
				}
				modifier = {
					factor = 1.5
					diplomacy = 16
				}
				modifier = {
					factor = 1.5
					diplomacy = 18
				}
				modifier = {
					factor = 1.5
					diplomacy = 20
				}
				set_character_flag = liege_opinion_slightly_decreased
				character_event = { id = PlusFaction.318 tooltip = EVTTOOLTIP1900731 } # faction opinion of liege slightly decreased
			}
			30 = {
				modifier = {
					factor = 1.5
					has_character_flag = faction_is_happy
				}
				modifier = {
					factor = 0.75
					has_character_flag = faction_is_unhappy
				}
				modifier = {
					factor = 1.5
					trait = stutter
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 8 }
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 5 }
				}
				modifier = {
					factor = 1.5
					NOT = { diplomacy = 2 }
				}
				modifier = {
					factor = 0.75
					diplomacy = 12
				}
				modifier = {
					factor = 0.75
					diplomacy = 14
				}
				modifier = {
					factor = 0.75
					diplomacy = 16
				}
				modifier = {
					factor = 0.5
					diplomacy = 18
				}
				modifier = {
					factor = 0.5
					diplomacy = 20
				}
				set_character_flag = liege_opinion_increased
				character_event = { id = PlusFaction.318 tooltip = EVTTOOLTIP1900734 } # faction opinion of liege increased
			}
		}
	}
	option = {
		name = "NEVERMIND"
		ai_chance = { factor = 0 }
		custom_tooltip = { text = CUSTOMTOOLTIP55 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.304 } #go back to setting agenda
		}
	}
}

# 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 = {
				NOT = { has_character_flag = liege_opinion_increased }
				leads_faction = faction_court
			}
			liege = { custom_tooltip = { text = COURTFACTIONMOODMINUS } }
		}
		if = {
			limit = {
				NOT = { has_character_flag = liege_opinion_increased }
				leads_faction = faction_prosperity
			}
			liege = { custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS } }
		}
		if = {
			limit = {
				NOT = { has_character_flag = liege_opinion_increased }
				leads_faction = faction_glory
			}
			liege = { custom_tooltip = { text = GLORYFACTIONMOODMINUS } }
		}
		if = {
			limit = {
				NOT = { has_character_flag = liege_opinion_increased }
				leads_faction = faction_tradition
			}
			liege = { custom_tooltip = { text = TRADITIONFACTIONMOODMINUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_increased
				leads_faction = faction_court
			}
			liege = { custom_tooltip = { text = COURTFACTIONMOODPLUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_increased
				leads_faction = faction_prosperity
			}
			liege = { custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_increased
				leads_faction = faction_glory
			}
			liege = { custom_tooltip = { text = GLORYFACTIONMOODPLUS } }
		}
		if = {
			limit = {
				has_character_flag = liege_opinion_increased
				leads_faction = faction_tradition
			}
			liege = { custom_tooltip = { text = TRADITIONFACTIONMOODPLUS } }
		}
		hidden_tooltip = {
			liege = {
				reverse_opinion = { who = ROOT modifier = rallied_against_liege multiplier = 2 years = 10 }
				character_event = { id = PlusFaction.320 } #notify
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.319 } #notify
				}
			}
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
}

# 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
	
	option = {
		name = OK
		if = {
			limit = { FROM = { has_character_flag = liege_opinion_decreased } }
			liege = { reverse_opinion = { who = ROOT modifier = turned_against_liege multiplier = 2 years = 10 } }
		}
		if = {
			limit = { FROM = { has_character_flag = liege_opinion_slightly_decreased } }
			liege = { reverse_opinion = { who = ROOT modifier = turned_against_liege years = 10 } }
		}
		if = {
			limit = { FROM = { has_character_flag = liege_opinion_increased } }
			liege = { reverse_opinion = { who = ROOT modifier = convinced_to_support_liege years = 10 } }
			opinion = { who = FROM modifier = upset_faction_decision years = 10 }
		}
		if = {
			limit = {
				FROM = { has_character_flag = faction_is_content }
				opinion = { who = liege value = 0 }
			}
			opinion = { who = FROM modifier = upset_faction_decision years = 10 }
		}
		if = {
			limit = {
				FROM = { has_character_flag = faction_is_happy }
				opinion = { who = liege value = 0 }
			}
			opinion = { who = FROM modifier = upset_faction_decision multiplier = 2 years = 10 }
		}
	}
}

# 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 = {
					NOT = { has_character_flag = liege_opinion_increased }
					leads_faction = faction_court
				}
			}
			custom_tooltip = { text = COURTFACTIONMOODMINUS }
		}
		if = {
			limit = {
				FROM = {
					NOT = { has_character_flag = liege_opinion_increased }
					leads_faction = faction_prosperity
				}
			}
			custom_tooltip = { text = PROSPERITYFACTIONMOODMINUS }
		}
		if = {
			limit = {
				FROM = {
					NOT = { has_character_flag = liege_opinion_increased }
					leads_faction = faction_glory
				}
			}
			custom_tooltip = { text = GLORYFACTIONMOODMINUS }
		}
		if = {
			limit = {
				FROM = {
					NOT = { has_character_flag = liege_opinion_increased }
					leads_faction = faction_tradition
				}
			}
			custom_tooltip = { text = TRADITIONFACTIONMOODMINUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_increased
					leads_faction = faction_court
				}
			}
			custom_tooltip = { text = COURTFACTIONMOODPLUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_increased
					leads_faction = faction_prosperity
				}
			}
			custom_tooltip = { text = PROSPERITYFACTIONMOODPLUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_increased
					leads_faction = faction_glory
				}
			}
			custom_tooltip = { text = GLORYFACTIONMOODPLUS }
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = liege_opinion_increased
					leads_faction = faction_tradition
				}
			}
			custom_tooltip = { text = TRADITIONFACTIONMOODPLUS }
		}
		opinion = { who = FROM modifier = rallied_against_liege multiplier = 2 years = 10 }
		hidden_tooltip = {
			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_tier_than = duke
					OR = {
						has_law = crown_authority_1
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}
				}
			}
		}
		ai_chance = {
			factor = 150
			modifier = {
				factor = 5
				liege = { primary_title = { title = e_hre } }
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_1
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_2
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_3
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_4
					}
				}
			}
			modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_CA
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTB_PlusFaction_321 # Lower Tribal Organization
		trigger = {
			liege = {
				is_tribal = yes
				independent = yes
				primary_title = {
					OR = {
						has_law = tribal_organization_1
						has_law = tribal_organization_2
						has_law = tribal_organization_3
						has_law = tribal_organization_4
					}
				}
			}
		}
		ai_chance = {
			factor = 150
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						has_law = tribal_organization_1
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_2
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_3
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_4
					}
				}
			}
			modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_TO
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTL_PlusFaction_321 # Lower Feudal/Iqta Obligations
		trigger = {
			liege = {
				primary_title = {
					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 = 100
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						OR = {
							has_law = feudal_obligations_1
							has_law = iqta_obligations_1
						}	
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						OR = {
							has_law = feudal_obligations_2
							has_law = iqta_obligations_2
						}	
					}
				}
			}
			modifier = {
				factor = 1.5
				liege = {
					primary_title = {
						OR = {
							has_law = feudal_obligations_3
							has_law = iqta_obligations_3
						}	
					}
				}
			}
			modifier = {
				factor = 2.0
				liege = {
					primary_title = {
						OR = {
							has_law = feudal_obligations_4
							has_law = iqta_obligations_4
						}	
					}
				}
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				liege = {
					primary_title = {
						NOR = {
							has_law = feudal_obligations_3
							has_law = iqta_obligations_3
							has_law = feudal_obligations_4
							has_law = iqta_obligations_4
						}	
					}
				}
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_feudal_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title
		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					tier = count
					location = { is_capital = no }
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}
			modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}
			modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}
			modifier = {
				factor = 1.25
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = envious
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}
			modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_surrender_title
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTM_PlusFaction_321 # Lower Tribal Obligations
		trigger = {
			is_tribal = yes
			liege = {
				primary_title = {
					OR = {
						has_law = tribal_obligations_1
						has_law = tribal_obligations_2
						has_law = tribal_obligations_3
						has_law = tribal_obligations_4
					}
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						has_law = tribal_obligations_1	
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_obligations_2	
					}
				}
			}
			modifier = {
				factor = 1.5
				liege = {
					primary_title = {
						has_law = tribal_obligations_3
					}
				}
			}
			modifier = {
				factor = 2.0
				liege = {
					primary_title = {
						has_law = tribal_obligations_4	
					}
				}
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				liege = {
					primary_title = {
						NOR = {
							has_law = tribal_obligations_3
							has_law = tribal_obligations_4
						}	
					}
				}
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_tribal_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = NEVERMIND
		ai_chance = { factor = 0 }
		custom_tooltip = { text = CUSTOMTOOLTIP55 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.304 } #go back to setting agenda
		}
	}
}

# 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 = {
				primary_title = {
					OR = {
						has_law = city_obligations_1
						has_law = city_obligations_2
						has_law = city_obligations_3
						has_law = city_obligations_4
					}
				}
			}
		}
		ai_chance = {
			factor = 150
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						has_law = city_obligations_1	
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = city_obligations_2	
					}
				}
			}
			modifier = {
				factor = 1.5
				liege = {
					primary_title = {
						has_law = city_obligations_3	
					}
				}
			}
			modifier = {
				factor = 2.0
				liege = {
					primary_title = {
						has_law = city_obligations_4	
					}
				}
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				liege = {
					primary_title = {
						NOR = {
							has_law = city_obligations_3
							has_law = city_obligations_4
						}	
					}
				}
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_city_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTH_PlusFaction_321 # Demand Wealth
		trigger = {
			liege = {
				wealth = 100
				NOT = { has_character_flag = loan_taken }
				NOT = { has_character_modifier = ai_austerity }
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 0.5
				trait = charitable
			}
			modifier = {
				factor = 1.25
				liege = { wealth = 200 }
			}
			modifier = {
				factor = 1.25
				liege = { wealth = 300 }
			}
			modifier = {
				factor = 1.25
				liege = { wealth = 400 }
			}
			modifier = {
				factor = 1.25
				liege = { wealth = 500 }
			}
			modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}
			modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_share_wealth
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title
		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					tier = count
					location = { is_capital = no }
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}
			modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}
			modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}
			modifier = {
				factor = 1.25
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = envious
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}
			modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_surrender_title
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTO_PlusFaction_321 # Lower Temple Obligations
		trigger = {
			liege = {
				primary_title = {
					OR = {
						has_law = temple_obligations_1
						has_law = temple_obligations_2
						has_law = temple_obligations_3
						has_law = temple_obligations_4
					}
				}
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				liege = {
					primary_title = {
						NOT = { has_law = temple_obligations_4 }
					}
				}
			}
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				is_theocracy = no
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_temple_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTL_PlusFaction_321 # Lower Feudal/Iqta Obligations
		trigger = {
			liege = {
				primary_title = {
					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
			modifier = {
				factor = 0
				liege = {
					primary_title = {
						NOR = {
							has_law = feudal_obligations_4
							has_law = iqta_obligations_4
						}	
					}
				}
			}
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				is_feudal = no
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_feudal_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTM_PlusFaction_321 # Lower Tribal Obligations
		trigger = {
			is_tribal = yes
			liege = {
				primary_title = {
					OR = {
						has_law = tribal_obligations_1
						has_law = tribal_obligations_2
						has_law = tribal_obligations_3
						has_law = tribal_obligations_4
					}
				}
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				liege = {
					primary_title = {
						NOT = { has_law = tribal_obligations_4 }
					}
				}
			}
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_tribal_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = NEVERMIND
		ai_chance = { factor = 0 }
		custom_tooltip = { text = CUSTOMTOOLTIP55 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.304 }
		}
	}
}

# 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 = {
				primary_title = {
					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 = 150
			modifier = {
				factor = 0
				liege = {
					primary_title = {
						NOR = {
							has_law = feudal_obligations_3
							has_law = iqta_obligations_3
							has_law = feudal_obligations_4
							has_law = iqta_obligations_4
						}	
					}
				}
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						OR = {
							has_law = feudal_obligations_3
							has_law = iqta_obligations_3
						}	
					}
				}
			}
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				liege = {
					primary_title = {
						OR = {
							has_law = feudal_obligations_3
							has_law = iqta_obligations_3
						}	
					}
				}
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_feudal_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTM_PlusFaction_321 # Lower Tribal Obligations
		trigger = {
			is_tribal = yes
			liege = {
				primary_title = {
					OR = {
						has_law = tribal_obligations_1
						has_law = tribal_obligations_2
						has_law = tribal_obligations_3
						has_law = tribal_obligations_4
					}
				}
			}
		}
		ai_chance = {
			factor = 150
			modifier = {
				factor = 0
				liege = {
					primary_title = {
						NOR = {
							has_law = tribal_obligations_3
							has_law = tribal_obligations_4
						}
					}
				}
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						has_law = tribal_obligations_3	
					}
				}
			}
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				liege = {
					primary_title = {
						has_law = tribal_obligations_3	
					}
				}
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_tribal_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTA_PlusFaction_321 # Lower Crown Authority
		trigger = {
			liege = {
				is_tribal = no
				any_demesne_title = {
					higher_tier_than = duke
					OR = {
						has_law = crown_authority_1
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}
				}
			}
		}
		ai_chance = {
			factor = 125
			modifier = {
				factor = 5
				liege = { primary_title = { title = e_hre } }
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_1
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_2
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_3
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_4
					}
				}
			}
			modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_CA
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTB_PlusFaction_321 # Lower Tribal Organization
		trigger = {
			liege = {
				is_tribal = yes
				independent = yes
				primary_title = {
					OR = {
						has_law = tribal_organization_1
						has_law = tribal_organization_2
						has_law = tribal_organization_3
						has_law = tribal_organization_4
					}
				}
			}
		}
		ai_chance = {
			factor = 125
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						has_law = tribal_organization_1
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_2
					}
				}
			}
			modifier = {
				factor = 1.5
				liege = {
					primary_title = {
						has_law = tribal_organization_3
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_4
					}
				}
			}
			modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_TO
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title
		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					tier = count
					location = { is_capital = no }
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}
			modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}
			modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}
			modifier = {
				factor = 1.25
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = envious
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}
			modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_surrender_title
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = NEVERMIND
		ai_chance = { factor = 0 }
		custom_tooltip = { text = CUSTOMTOOLTIP55 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.304 }
		}
	}
}

# 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 = {
				primary_title = {
					OR = {
						has_law = temple_obligations_1
						has_law = temple_obligations_2
						has_law = temple_obligations_3
						has_law = temple_obligations_4
					}
				}
			}
		}
		ai_chance = {
			factor = 150
			modifier = {
				factor = 1.5
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						has_law = temple_obligations_1	
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = temple_obligations_2	
					}
				}
			}
			modifier = {
				factor = 1.5
				liege = {
					primary_title = {
						has_law = temple_obligations_3	
					}
				}
			}
			modifier = {
				factor = 2.0
				liege = {
					primary_title = {
						has_law = temple_obligations_4	
					}
				}
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
				liege = {
					primary_title = {
						NOR = {
							has_law = temple_obligations_3
							has_law = temple_obligations_4
						}	
					}
				}
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_temple_obligations
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTJ_PlusFaction_321 # Revert Succession Law
		trigger = {
			liege = {
				primary_title = {
					OR = {
						AND = {
							has_title_flag = former_gavelkind
							NOT = { has_law = succ_gavelkind }
						}
						AND = {
							has_title_flag = former_seniority
							NOT = { has_law = succ_seniority }
						}
						AND = {
							has_title_flag = former_primogeniture
							NOT = { has_law = succ_primogeniture }
						}
						AND = {
							has_title_flag = former_feudal_elective
							NOT = { has_law = succ_feudal_elective }
						}
						AND = {
							has_title_flag = former_tanistry
							NOT = { has_law = succ_tanistry }
						}
						AND = {
							has_title_flag = former_ultimogeniture
							NOT = { has_law = succ_ultimogeniture }
						}
						AND = {
							has_title_flag = former_cognatic_succession
							NOT = { has_law = cognatic_succession }
						}
						AND = {
							has_title_flag = former_agnatic_succession
							NOT = { has_law = agnatic_succession }
						}
						AND = {
							has_title_flag = former_true_cognatic_succession
							NOT = { has_law = true_cognatic_succession }
						}
					}
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 1.5
				trait = content
			}
			modifier = {
				factor = 1.5
				trait = zealous
			}
			modifier = {
				factor = 0.75
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_revert_succession
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTK_PlusFaction_321 # Council Life Terms
		trigger = {
			liege = {
				primary_title = { has_law = council_privileges_0 }
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.25
				has_character_flag = faction_is_angry
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_council_life_terms
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTE_PlusFaction_321 # Surrender a Title
		trigger = {
			liege = {
				any_demesne_title = {
					can_be_given_away = yes
					tier = count
					location = { is_capital = no }
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 2.01 }
			}
			modifier = {
				factor = 0.5
				liege = { demesne_efficiency = 1.01 }
			}
			modifier = {
				factor = 1.5
				liege = { NOT = { demesne_efficiency = 0.51 } }
			}
			modifier = {
				factor = 5
				liege = { NOT = { demesne_efficiency = 0.26 } }
			}
			modifier = {
				factor = 1.25
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = envious
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 1.5
				has_character_flag = faction_is_angry
			}
			modifier = {
				factor = 0.5
				NOT = { has_character_flag = faction_is_angry }
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_surrender_title
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTA_PlusFaction_321 # Lower Crown Authority
		trigger = {
			liege = {
				is_tribal = no
				any_demesne_title = {
					higher_tier_than = duke
					OR = {
						has_law = crown_authority_1
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}
				}
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 10
				liege = { primary_title = { title = e_hre } }
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_1
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_2
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_3
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					any_demesne_title = {
						higher_tier_than = duke
						has_law = crown_authority_4
					}
				}
			}
			modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_CA
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = EVTOPTB_PlusFaction_321 # Lower Tribal Organization
		trigger = {
			liege = {
				is_tribal = yes
				independent = yes
				primary_title = {
					OR = {
						has_law = tribal_organization_1
						has_law = tribal_organization_2
						has_law = tribal_organization_3
						has_law = tribal_organization_4
					}
				}
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 0.5
				liege = {
					primary_title = {
						has_law = tribal_organization_1
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_2
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_3
					}
				}
			}
			modifier = {
				factor = 1.25
				liege = {
					primary_title = {
						has_law = tribal_organization_4
					}
				}
			}
			modifier = {
				factor = 2
				has_character_flag = faction_is_angry
			}
		}
		hidden_tooltip = {
			set_character_flag = demands_lower_TO
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.339 } #vote
				}
			}
		}
		pf_leader_vote_effect = yes
		character_event = { id = PlusFaction.340 days = 7 tooltip = EVTTOOLTIP1900740 }
	}
	option = {
		name = NEVERMIND
		ai_chance = { factor = 0 }
		custom_tooltip = { text = CUSTOMTOOLTIP55 }
		hidden_tooltip = {
			character_event = { id = PlusFaction.304 }
		}
	}
}

### 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
		ai_chance = {
			factor = 35
			modifier = {
				factor = 1.5
				liege = { ai = yes }
				FROM = { ai = yes }
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = faction_is_unhappy }
			}
			modifier = {
				factor = 0.1
				FROM = { has_character_flag = faction_is_angry }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = 0 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -10 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -20 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -30 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -40 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -50 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -60 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -70 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -80 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = liege value = -90 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -10 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -30 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -40 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -60 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -70 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -80 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -90 } }
			}
			modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = proud
			}
			modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_money_liege }
				trait = greedy
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_money_liege }
				OR = {
					AND = {
						real_tier = KING
						NOT = { wealth = 30 }
					}
					AND = {
						real_tier = DUKE
						NOT = { wealth = 20 }
					}
					AND = {
						real_tier = COUNT
						NOT = { wealth = 10 }
					}
					AND = {
						real_tier = BARON
						NOT = { wealth = 5 }
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_support_liege }
				OR = {
					AND = {
						real_tier = KING
						NOT = { prestige = 250 }
					}
					AND = {
						real_tier = DUKE
						NOT = { prestige = 100 }
					}
					AND = {
						real_tier = COUNT
						NOT = { prestige = 50 }
					}
					AND = {
						real_tier = BARON
						NOT = { prestige = 25 }
					}
				}
			}
		}
		FROM = {
			ROOT = { pf_member_vote_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_supported_in_meeting
				years = 3
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_330 #vote no
		ai_chance = {
			factor = 65
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 10 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 20 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 30 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 40 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 60 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 70 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 80 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = liege value = 90 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 10 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 30 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 70 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 80 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 90 }
			}
			modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = humble
			}
			modifier = {
				factor = 0.75
				FROM = { has_character_flag = demand_support_liege }
				trait = content
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_money_liege }
				trait = charitable
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_money_liege }
				OR = {
					AND = {
						real_tier = KING
						wealth = 90
					}
					AND = {
						real_tier = DUKE
						wealth = 60
					}
					AND = {
						real_tier = COUNT
						wealth = 30
					}
					AND = {
						real_tier = BARON
						wealth = 15
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demand_support_liege }
				OR = {
					AND = {
						real_tier = KING
						prestige = 1000
					}
					AND = {
						real_tier = DUKE
						prestige = 500
					}
					AND = {
						real_tier = COUNT
						prestige = 250
					}
					AND = {
						real_tier = BARON
						prestige = 100
					}
				}
			}
		}
		FROM = {
			ROOT = { pf_member_vote_against_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_opposed_in_meeting
				years = 3
			}
		}
		if = {
			limit = {
				FROM = { has_character_flag = faction_is_unhappy }
				NOT = { opinion = { who = liege value = 0 } }
			}
			opinion = { who = FROM modifier = upset_faction_decision years = 10 }
		}
		if = {
			limit = {
				FROM = { has_character_flag = faction_is_angry }
				opinion = { who = liege value = 0 }
			}
			opinion = { who = FROM modifier = upset_faction_decision multiplier = 2 years = 10 }
		}
		if = {
			limit = {
				FROM = { has_character_flag = faction_is_angry }
				NOT = { opinion = { who = liege value = 0 } }
			}
			opinion = { who = FROM modifier = upset_faction_decision multiplier = 3 years = 10 }
		}
	}
}

# 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.5 }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		if = {
			limit = { has_character_flag = demand_money_liege }
			if = { limit = { real_tier = king }  wealth = -30 }
			if = { limit = { real_tier = duke }  wealth = -20 }
			if = { limit = { real_tier = count } wealth = -10 }
			if = { limit = { real_tier = baron } wealth = -5  }
		}
		if = {
			limit = { has_character_flag = demand_support_liege }
			if = {
				limit = { real_tier = king }
				custom_tooltip = { text = TRANSFER_250_PRESTIGE }
				hidden_tooltip = { prestige = -250 }
			}
			if = {
				limit = { real_tier = duke }
				custom_tooltip = { text = TRANSFER_100_PRESTIGE }
				hidden_tooltip = { prestige = -100 }
			}
			if = {
				limit = { real_tier = count }
				custom_tooltip = { text = TRANSFER_50_PRESTIGE }
				hidden_tooltip = { prestige = -50 }
			}
			if = {
				limit = { real_tier = baron }
				custom_tooltip = { text = TRANSFER_25_PRESTIGE }
				hidden_tooltip = { prestige = -25 }
			}
		}
		if = {
			limit = { real_tier = COUNT }
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = { real_tier = DUKE }
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = { real_tier = KING }
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		liege = { letter_event = { id = PlusFaction.334 tooltip = EVTTOOLTIPGIFT } }
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.332 } #notify
				}
			}
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_331 #vote failed
		trigger = {
			NOT = { check_variable = { which = "faction_votes" value = 0.5 } }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.333 } #notify
				}
			}
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
}

# 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 } }
			if = { limit = { real_tier = king }  wealth = -30 }
			if = { limit = { real_tier = duke }  wealth = -20 }
			if = { limit = { real_tier = count } wealth = -10 }
			if = { limit = { real_tier = baron } wealth = -5  }
		}
		if = {
			limit = { FROM = { has_character_flag = demand_support_liege } }
			if = {
				limit = { real_tier = king }
				custom_tooltip = { text = TRANSFER_250_PRESTIGE }
				hidden_tooltip = { prestige = -250 }
			}
			if = {
				limit = { real_tier = duke }
				custom_tooltip = { text = TRANSFER_100_PRESTIGE }
				hidden_tooltip = { prestige = -100 }
			}
			if = {
				limit = { real_tier = count }
				custom_tooltip = { text = TRANSFER_50_PRESTIGE }
				hidden_tooltip = { prestige = -50 }
			}
			if = {
				limit = { real_tier = baron }
				custom_tooltip = { text = TRANSFER_25_PRESTIGE }
				hidden_tooltip = { prestige = -25 }
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = 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 = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = 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 = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
				}
				if = { limit = { real_tier = king }  ROOT = { wealth = 30 } }
				if = { limit = { real_tier = duke }  ROOT = { wealth = 20 } }
				if = { limit = { real_tier = count } ROOT = { wealth = 10 } }
				if = { limit = { real_tier = baron } ROOT = { wealth = 5  } }
				hidden_tooltip = {
					reverse_opinion = { who = ROOT modifier = opinion_pleased years = 5 }
				}
			}
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_court
				}
			}
			add_character_modifier = { name = faction_court_bonus duration = 1825 }
			hidden_tooltip = {
				any_vassal = {
					limit = { in_faction = faction_court }
					reverse_opinion = { who = ROOT modifier = opinion_pleased years = 5 }
				}
			}
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_prosperity
				}
			}
			add_character_modifier = { name = faction_prosperity_bonus duration = 1825 }
			hidden_tooltip = {
				any_vassal = {
					limit = { in_faction = faction_prosperity }
					reverse_opinion = { who = ROOT modifier = opinion_pleased years = 5 }
				}
			}
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_glory
				}
			}
			any_vassal = {
				limit = { in_faction = faction_glory }
				if = { limit = { real_tier = king }  ROOT = { prestige = 100 } }
				if = { limit = { real_tier = duke }  ROOT = { prestige = 50 } }
				if = { limit = { real_tier = count } ROOT = { prestige = 25 } }
				if = { limit = { real_tier = baron } ROOT = { prestige = 10 } }
				hidden_tooltip = {
					reverse_opinion = { who = ROOT modifier = opinion_pleased years = 5 }
				}
			}
		}
		if = {
			limit = {
				FROM = {
					has_character_flag = demand_support_liege
					leads_faction = faction_tradition
				}
			}
			any_vassal = {
				limit = { in_faction = faction_tradition }
				if = { limit = { real_tier = king }  ROOT = { piety = 100 } }
				if = { limit = { real_tier = duke }  ROOT = { piety = 50 } }
				if = { limit = { real_tier = count } ROOT = { piety = 25 } }
				if = { limit = { real_tier = baron } ROOT = { piety = 5 } }
				hidden_tooltip = {
					reverse_opinion = { who = ROOT modifier = opinion_pleased 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
		ai_chance = {
			factor = 35
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -10 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -30 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -40 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -60 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -70 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -80 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -90 } }
			}
			modifier = {
				factor = 0.5
				trait = greedy
			}
			modifier = {
				factor = 0.5
				OR = {
					AND = {
						real_tier = KING
						NOT = { wealth = 30 }
					}
					AND = {
						real_tier = DUKE
						NOT = { wealth = 20 }
					}
					AND = {
						real_tier = COUNT
						NOT = { wealth = 10 }
					}
					AND = {
						real_tier = BARON
						NOT = { wealth = 5 }
					}
				}
			}
		}
		FROM = {
			ROOT = { pf_member_vote_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_supported_in_meeting
				years = 3
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_330 #vote no
		ai_chance = {
			factor = 65
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 10 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 30 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 70 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 80 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 90 }
			}
			modifier = {
				factor = 0.5
				trait = charitable
			}
			modifier = {
				factor = 0.5
				OR = {
					AND = {
						real_tier = KING
						wealth = 60
					}
					AND = {
						real_tier = DUKE
						wealth = 40
					}
					AND = {
						real_tier = COUNT
						wealth = 20
					}
					AND = {
						real_tier = BARON
						wealth = 10
					}
				}
			}
		}
		FROM = {
			ROOT = { pf_member_vote_against_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_opposed_in_meeting
				years = 3
			}
		}
		if = {
			limit = { ai = yes }
			random_list = {
				50 = {
					modifier = {
						factor = 0
						NOT = { opinion = { who = FROM value = 0 } }
					}
					#no effect
				}
				50 = {
					opinion = { who = FROM modifier = upset_faction_decision years = 10 }
				}
				50 = {
					modifier = {
						factor = 0
						opinion = { who = FROM value = 0 }
					}
					modifier = {
						factor = 2
						NOT = { opinion = { who = FROM value = -25 } }
					}
					modifier = {
						factor = 2
						NOT = { opinion = { who = FROM value = -50 } }
					}
					opinion = { who = FROM modifier = upset_faction_decision multiplier = 2 years = 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.5 }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		if = {
			limit = { real_tier = COUNT }
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = { real_tier = DUKE }
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = { real_tier = KING }
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = { pf_root_faction_backer_trigger = yes }
				if = { limit = { real_tier = king }  ROOT = { wealth = 30 } }
				if = { limit = { real_tier = duke }  ROOT = { wealth = 20 } }
				if = { limit = { real_tier = count } ROOT = { wealth = 10 } }
				if = { limit = { real_tier = baron } ROOT = { wealth = 5  } }
				hidden_tooltip = { character_event = { id = PlusFaction.337 } } #notify
			}
		}
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_331 #vote failed
		trigger = {
			NOT = { check_variable = { which = "faction_votes" value = 0.5 } }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.338 } #notify
				}
			}
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
}

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

	option = {
		name = OK
		if = { limit = { real_tier = king }  wealth = -30 }
		if = { limit = { real_tier = duke }  wealth = -20 }
		if = { limit = { real_tier = count } wealth = -10 }
		if = { limit = { real_tier = baron } wealth = -5  }
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = 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

	option = {
		name = OK
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = 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
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0.5
				NOT = { trait = deceitful }
				liege = { reverse_has_opinion_modifier = { who = ROOT modifier = sworn_to_support_heir } }
			}
			modifier = {
				factor = 0.1
				liege = { any_war = { defender = { character = PREVPREV } } }
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_court
					NOT = { faction_power = { faction = faction_court power = 0.75 } }
				}
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_prosperity
					NOT = { faction_power = { faction = faction_prosperity power = 0.75 } }
				}
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_glory
					NOT = { faction_power = { faction = faction_glory power = 0.75 } }
				}
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_tradition
					NOT = { faction_power = { faction = faction_tradition power = 0.75 } }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_court
					faction_power = { faction = faction_court power = 1.99 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_prosperity
					faction_power = { faction = faction_prosperity power = 1.99 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_glory
					faction_power = { faction = faction_glory power = 1.99 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_tradition
					faction_power = { faction = faction_tradition power = 1.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_court
					faction_power = { faction = faction_court power = 2.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_prosperity
					faction_power = { faction = faction_prosperity power = 2.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_glory
					faction_power = { faction = faction_glory power = 2.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_tradition
					faction_power = { faction = faction_tradition power = 2.99 }
				}
			}
			modifier = {
				factor = 1.25
				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
					}
				}
				in_faction = faction_court
			}
			modifier = {
				factor = 1.25
				FROM = {
					OR = {
						has_character_flag = demands_tax_privilege
						has_character_flag = demands_lower_city_obligations
					}
				}
				in_faction = faction_prosperity
			}
			modifier = {
				factor = 1.25
				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
					}
				}
				in_faction = faction_glory
			}
			modifier = {
				factor = 1.25
				FROM = {
					OR = {
						has_character_flag = demands_lower_temple_obligations
						has_character_flag = demands_revert_succession
						has_character_flag = demands_surrender_title
					}
				}
				in_faction = faction_tradition
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 10 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 20 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 30 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 40 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 60 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 70 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 80 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 90 }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -10 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -30 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -40 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -60 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -70 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -80 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = FROM value = -90 } }
			}
			modifier = {
				factor = 1.1
				FROM = { has_character_flag = demands_surrender_title }
				event_target:faction_demanded_title_for = {
					NOT = { character = ROOT }
					NOT = { character = FROM }
					reverse_opinion = { who = ROOT value = 25 }
				}
			}
			modifier = {
				factor = 1.1
				FROM = { has_character_flag = demands_surrender_title }
				event_target:faction_demanded_title_for = {
					NOT = { character = ROOT }
					NOT = { character = FROM }
					reverse_opinion = { who = ROOT value = 50 }
				}
			}
			modifier = {
				factor = 1.1
				FROM = { has_character_flag = demands_surrender_title }
				event_target:faction_demanded_title_for = {
					NOT = { character = ROOT }
					NOT = { character = FROM }
					reverse_opinion = { who = ROOT value = 75 }
				}
			}
			modifier = {
				factor = 0.5
				trait = craven
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = {
				factor = 0.5
				FROM = {
					OR = {
						has_character_flag = demands_share_wealth
						has_character_flag = demands_surrender_title
					}
				}
				trait = charitable
			}
			modifier = {
				factor = 0.5
				FROM = {
					OR = {
						has_character_flag = demands_share_wealth
						has_character_flag = demands_surrender_title
					}
				}
				trait = kind
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demands_share_wealth }
				scaled_wealth = 5.0
			}
		}
		FROM = {
			ROOT = { pf_member_vote_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_supported_in_meeting
				years = 3
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_339 #vote no
		ai_chance = {
			factor = 25
			modifier = {
				factor = 0.1
				FROM = { has_character_flag = demands_surrender_title }
				event_target:faction_demanded_title_for = { character = ROOT }
			}
			modifier = {
				factor = 3.0
				FROM = {
					NOT = { has_character_flag = faction_is_angry }
				}
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = 0 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -10 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -20 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -30 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -40 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -50 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -60 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -70 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -80 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -90 } }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 10 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 30 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 70 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 80 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = FROM value = 90 }
			}
			modifier = {
				factor = 1.1
				FROM = { has_character_flag = demands_surrender_title }
				event_target:faction_demanded_title_for = {
					NOT = { character = ROOT }
					NOT = { character = FROM }
					NOT = { reverse_opinion = { who = ROOT value = -25 } }
				}
			}
			modifier = {
				factor = 1.1
				FROM = { has_character_flag = demands_surrender_title }
				event_target:faction_demanded_title_for = {
					NOT = { character = ROOT }
					NOT = { character = FROM }
					NOT = { reverse_opinion = { who = ROOT value = -50 } }
				}
			}
			modifier = {
				factor = 1.1
				FROM = { has_character_flag = demands_surrender_title }
				event_target:faction_demanded_title_for = {
					NOT = { character = ROOT }
					NOT = { character = FROM }
					NOT = { reverse_opinion = { who = ROOT value = -75 } }
				}
			}
			modifier = {
				factor = 0.5
				trait = proud
			}
			modifier = {
				factor = 0.5
				trait = ambitious
			}
			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
			}
			modifier = {
				factor = 0.5
				FROM = {
					OR = {
						has_character_flag = demands_surrender_title
						has_character_flag = demands_share_wealth
					}
				}
				trait = envious
			}
			modifier = {
				factor = 0.5
				FROM = { has_character_flag = demands_share_wealth }
				NOT = { wealth = 0 }
			}
		}
		FROM = {
			ROOT = { pf_member_vote_against_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_opposed_in_meeting
				years = 3
			}
		}
	}
}

# 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.5 }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		# allow the faction leader to now take the 'Make Ultimatum to Liege' decision
		# and set the timer so the AI doesn't use the decision for 30 days (unless everyone has joined)
		custom_tooltip = {
			text = MAY_TAKE_ULTIMATUM_DECISION
			hidden_tooltip = {
				set_character_flag = civil_war_faction_leader
				add_character_modifier = {
					name = declare_civil_war_timer
					duration = 30
					hidden = yes
				}
			}
		}
		# 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
		liege = {
			custom_tooltip = { text = INVITE_TO_JOIN_CIVIL_WAR }
			hidden_tooltip = {
				any_vassal = {
					limit = {
						is_playable = yes
						pf_root_faction_backer_trigger = no
					}
					letter_event = { id = PlusFaction.415 }
				}
			}
		}
		if = {
			limit = { real_tier = COUNT }
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = { real_tier = DUKE }
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = { real_tier = KING }
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.341 } #notify
				}
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_331 #vote failed
		trigger = {
			NOT = { check_variable = { which = "faction_votes" value = 0.5 } }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.342 } #notify
				}
			}
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
		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

	option = {
		name = OK
		set_character_flag = civil_war_faction_member
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = 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
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		if = {
			limit = { ai = yes }
			random_list = {
				50 = {
					modifier = {
						factor = 0
						NOT = { opinion = { who = FROM value = 0 } }
					}
					#no effect
				}
				50 = {
					opinion = { who = FROM modifier = upset_faction_decision years = 10 }
				}
				50 = {
					modifier = {
						factor = 0
						opinion = { who = FROM value = 0 }
					}
					modifier = {
						factor = 2
						NOT = { opinion = { who = FROM value = -25 } }
					}
					modifier = {
						factor = 2
						NOT = { opinion = { who = FROM value = -50 } }
					}
					opinion = { who = FROM modifier = upset_faction_decision multiplier = 2 years = 10 }
				}
			}
		}
	}
}

# 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
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0.5
				NOT = { trait = deceitful }
				liege = { reverse_has_opinion_modifier = { who = ROOT modifier = sworn_to_support_heir } }
			}
			modifier = {
				factor = 0.1
				liege = { any_war = { defender = { character = PREVPREV } } }
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_court
					NOT = { faction_power = { faction = faction_court power = 0.75 } }
				}
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_prosperity
					NOT = { faction_power = { faction = faction_prosperity power = 0.75 } }
				}
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_glory
					NOT = { faction_power = { faction = faction_glory power = 0.75 } }
				}
			}
			modifier = {
				factor = 0.1
				FROM = {
					leads_faction = faction_tradition
					NOT = { faction_power = { faction = faction_tradition power = 0.75 } }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_court
					faction_power = { faction = faction_court power = 1.99 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_prosperity
					faction_power = { faction = faction_prosperity power = 1.99 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_glory
					faction_power = { faction = faction_glory power = 1.99 }
				}
			}
			modifier = {
				factor = 1.5
				FROM = {
					leads_faction = faction_tradition
					faction_power = { faction = faction_tradition power = 1.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_court
					faction_power = { faction = faction_court power = 2.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_prosperity
					faction_power = { faction = faction_prosperity power = 2.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_glory
					faction_power = { faction = faction_glory power = 2.99 }
				}
			}
			modifier = {
				factor = 2.0
				FROM = {
					leads_faction = faction_tradition
					faction_power = { faction = faction_tradition power = 2.99 }
				}
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 10 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 20 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 30 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 40 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 50 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 60 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 70 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 80 }
			}
			modifier = {
				factor = 0.9
				opinion = { who = liege value = 90 }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -10 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -30 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -40 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -60 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -70 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -80 } }
			}
			modifier = {
				factor = 0.95
				NOT = { opinion = { who = FROM value = -90 } }
			}
			modifier = {
				factor = 1.5
				trait = brave
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 1.25
				trait = wroth
			}
		}
		FROM = {
			ROOT = { pf_member_vote_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_supported_in_meeting
				years = 3
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_343 #vote no
		ai_chance = {
			factor = 25
			modifier = {
				factor = 3.0
				FROM = { NOT = { has_character_flag = faction_is_angry } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = 0 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -10 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -20 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -30 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -40 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -50 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -60 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -70 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -80 } }
			}
			modifier = {
				factor = 0.9
				NOT = { opinion = { who = liege value = -90 } }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 10 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 30 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 70 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 80 }
			}
			modifier = {
				factor = 0.95
				opinion = { who = FROM value = 90 }
			}
			modifier = {
				factor = 1.5
				trait = craven
			}
			modifier = {
				factor = 1.25
				trait = content
			}
			modifier = {
				factor = 1.25
				trait = humble
			}
			modifier = {
				factor = 1.25
				trait = patient
			}
		}
		FROM = {
			ROOT = { pf_member_vote_against_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_opposed_in_meeting
				years = 3
			}
		}
		if = {
			limit = { ai = yes }
			opinion = { who = FROM modifier = upset_faction_decision multiplier = 2 years = 10 }
		}
	}
}

# 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.5 }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		# allow the faction leader to now take the 'Begin Civil War' decision
		# and set the timer so the AI doesn't use the decision for 30 days (unless everyone has joined)
		custom_tooltip = {
			text = MAY_TAKE_CIVIL_WAR_DECISION
			hidden_tooltip = {
				set_character_flag = civil_war_faction_leader
				add_character_modifier = {
					name = declare_civil_war_timer
					duration = 30
					hidden = yes
				}
			}
		}
		# invite all other vassals to join the coming civil war
		liege = {
			custom_tooltip = { text = INVITE_TO_JOIN_CIVIL_WAR }
			hidden_tooltip = {
				any_vassal = {
					limit = {
						is_playable = yes
						pf_root_faction_backer_trigger = no
					}
					letter_event = { id = PlusFaction.415 }
				}
			}
		}
		
		if = {
			limit = { real_tier = COUNT }
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = { real_tier = DUKE }
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = { real_tier = KING }
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.345 } #notify
				}
			}
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_344 #vote failed and I was removed from power
		trigger = {
			NOT = { check_variable = { which = "faction_votes" value = 0.5 } }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_root_faction_backer_trigger = yes
						character = ROOT
					}
					OR = {
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
						character = ROOT
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.346 } #notify
				}
			}
		}
		custom_tooltip = { text = CUSTOMTOOLTIP45 }
		set_character_flag = former_faction_leader
		set_character_flag = removed_from_leadership
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
			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

	option = {
		name = OK
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = 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

	option = {
		name = OK
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP46DD }
		}
		liege = {
			any_vassal = {
				limit = {
					OR = {
						pf_from_faction_backer_trigger = yes
						character = FROM
					}
					OR = {
						reverse_has_opinion_modifier = { who = FROM modifier = opinion_supported_in_meeting }
						character = FROM
					}
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = COUNT
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = DUKE
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = {
				reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				real_tier = KING
			}
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_from_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = FROM modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = 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
		ai_chance = { factor = 90 }
		custom_tooltip = { text = CUSTOMTOOLTIP44 }
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.351 } #vote
				}
			}
		}
		hidden_tooltip = {
			if = {
				limit = { real_tier = BARON }
				change_variable = { which = "faction_votes" value = -1 }
			}
			if = {
				limit = { real_tier = COUNT }
				change_variable = { which = "faction_votes" value = -2 }
			}
			if = {
				limit = { real_tier = DUKE }
				change_variable = { which = "faction_votes" value = -4 }
			}
			if = {
				limit = { real_tier = KING }
				change_variable = { which = "faction_votes" value = -8 }
			}
		}
		character_event = { id = PlusFaction.352 days = 7 }
	}
	option = {
		name = EVTOPTB_PlusFaction_350 #step down voluntarily
		ai_chance = {
			factor = 10
			modifier = {
				factor = 10
				trait = content 
			}
			modifier = {
				factor = 5
				trait = humble
			}
			modifier = {
				factor = 0
				OR = {
					trait = ambitious
					trait = proud
					trait = wroth
				}
			}
		}
		custom_tooltip = { text = CUSTOMTOOLTIP45 }
		if = {
			limit = { lower_real_tier_than = duke }
			prestige = -50
		}
		if = {
			limit = { real_tier = duke }
			prestige = -100
		}
		if = {
			limit = { real_tier = king }
			prestige = -200
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.355 } #notify
				}
			}
		}
		set_character_flag = former_faction_leader
		set_character_flag = removed_from_leadership
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
}

# 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
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.75
				lower_real_tier_than = FROM
			}
			modifier = {
				factor = 2.0
				has_opinion_modifier = { who = FROM modifier = upset_faction_decision }
			}
			modifier = {
				factor = 0.5
				opinion = { who = FROM value = 0 }
			}
			modifier = {
				factor = 0.5
				opinion = { who = FROM value = 10 }
			}
			modifier = {
				factor = 0
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 0.75
				trait = kind
			}
			modifier = {
				factor = 0.75
				trait = patient
			}
			modifier = {
				factor = 0.75
				trait = humble
			}
			modifier = {
				factor = 0.75
				trait = content
			}
		}
		FROM = {
			ROOT = { pf_member_vote_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_opposed_in_meeting
				multiplier = 2
				years = 10
			}
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_351 #vote no
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.75
				higher_real_tier_than = FROM
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = -10 } }
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -30 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -40 } }
			}
			modifier = {
				factor = 0
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.75
				trait = envious
			}
			modifier = {
				factor = 0.75
				trait = wroth
			}
			modifier = {
				factor = 0.75
				trait = cruel
			}
			modifier = {
				factor = 0.75
				trait = ambitious
			}
		}
		FROM = {
			ROOT = { pf_member_vote_against_effect = yes }
			opinion = {
				who = ROOT
				modifier = opinion_supported_in_meeting
				multiplier = 2
				years = 10
			}
		}
	}
}

# 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.5 }
		}
		custom_tooltip = { text = CUSTOMTOOLTIP45 }
		if = {
			limit = { lower_real_tier_than = duke }
			prestige = -100
		}
		if = {
			limit = { real_tier = duke }
			prestige = -200
		}
		if = {
			limit = { real_tier = king }
			prestige = -400
		}
		set_character_flag = former_faction_leader
		set_character_flag = removed_from_leadership
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		if = {
			limit = { real_tier = COUNT }
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = { real_tier = DUKE }
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = { real_tier = KING }
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.353 } #notify
				}
			}
		}
		hidden_tooltip = {
			character_event = { id = PlusFaction.399 days = 1 } #clear flags
		}
	}
	option = {
		name = EVTOPTB_PlusFaction_352 #leadership retained
		trigger = {
			NOT = { check_variable = { which = "faction_votes" value = 0.5 } }
		}
		hidden_tooltip = {
			set_variable = { which = "faction_votes" value = 0 }
		}
		clr_character_flag = faction_leadership_challenge
		set_character_flag = faction_meeting_called
		prestige = 50
		custom_tooltip = { text = MEETING_CONTINUES }
		if = {
			limit = { real_tier = COUNT }
			custom_tooltip = { text = CUSTOMTOOLTIP47BB }
		}
		if = {
			limit = { real_tier = DUKE }
			custom_tooltip = { text = CUSTOMTOOLTIP47CC }
		}
		if = {
			limit = { real_tier = KING }
			custom_tooltip = { text = CUSTOMTOOLTIP47DD }
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP47A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP47B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP47C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP47D }
				}
			}
		}
		liege = {
			any_vassal = {
				limit = {
					pf_root_faction_backer_trigger = yes
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_opposed_in_meeting }
				}
				if = {
					limit = { real_tier = BARON }
					custom_tooltip = { text = CUSTOMTOOLTIP46A }
				}
				if = {
					limit = { real_tier = COUNT }
					custom_tooltip = { text = CUSTOMTOOLTIP46B }
				}
				if = {
					limit = { real_tier = DUKE }
					custom_tooltip = { text = CUSTOMTOOLTIP46C }
				}
				if = {
					limit = { real_tier = KING }
					custom_tooltip = { text = CUSTOMTOOLTIP46D }
				}
			}
		}
		hidden_tooltip = {
			liege = {
				any_vassal = {
					limit = { pf_root_faction_backer_trigger = yes }
					character_event = { id = PlusFaction.354 } #notify
				}
			}
			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
	}
}

# 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
	}
}

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

