## Devil Worshippers ##
unseelie_petitioners = {
	primary_attribute = intrigue
	is_secret = yes
	criminal = yes
	devil_worshipper = yes
	opinion_to_other_members = +5
	opinion_to_pretenders = -40			#Pretenders is the opinion you have of people perceived/discovered to be in your society.
	opinion_to_perceived_members = -40	#Perceived is the opinion you have of people perceived/discovered to be of a society you're not part of
	opinion_per_rank_above = +10
	sound = devil_worshippers_interface
	society_ranks_gfx = devil_ranks
	
	active = {
		has_dlc = "Mystics"
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
	}
	indestructible = yes
	
	can_join_society = {
		NAND = {
			ai = yes
			trait = full_cybernetic_conversion
		}		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = unseelie_petitioners
					rank = 1
				}
			}
		}
		has_unseelie_prerequisites = yes
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}
	
	show_society = {
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
		age = 16
		OR = {
			religion_openly_in_celtic_subgroup_trigger = yes
			religion_secretly_in_celtic_subgroup_trigger = yes
			society_member_of = unseelie_petitioners
		}
	}
	
	potential = { } #no rules
	
	society_rank = {
		level = 1
		limit = 100 
		startup_limit = 10
		decisions = {
			prisoner_dark_sacrifice #Available Decision: Sacrifice Prisoner
			#Over time, lose virtues, gain vices. A Soul Corruption-effect is on a yearly pulse (with a chance to do nothing)
		}
	}
	
	society_rank = { 
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = unseelie_petitioners
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 1
		}
		decisions = {
			devil_worshipers_summon_familiar #Available Power: Summon Familiar
			the_devil_worshipers_tainted_touch #Available Power: Curse people with disease
			devil_worshipers_demonic_possession #Available Power: Possess someone to make fanatically loyal
			#Available Power: Abduction plot
			#unlock new options in Seduction and Spy On?
		}
	}
	
	society_rank = {
		level = 3
		limit = 25 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = unseelie_petitioners
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 2
		}
		decisions = {
			devil_worshipers_dark_divorce #Available Power: Dark Divorce
			devil_worshipers_dark_healing #Available Power: Demonic Healing. Sacrifice a prisoner to heal a random illness or maiming.
			devil_worshipers_invite_disciple_of_devil #Available Decision: Invite a witch to court
			#Available Power: Love Potion
		}
	}

	society_rank = {
		level = 4
		limit = 1 
		startup_limit = 1
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = unseelie_petitioners
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 3
		}
		decisions = {
			DW_prolong_life #Available Power: Prolong Life
			DW_demonic_impregnation #Available power: Unholy Impregnation
		}
		obedience_tooltip = obedience_tooltip #this can be unique per rank/society 
		obedient = {
			ROOT = {
				always = yes
			}
		}		
	}

	plots = {
		plot1_tag
		plot2_tag
	}
    
	ambitions = {
		ambition1_tag
		ambition2_tag
	}

	monthly_currency_gain = {
		name = currency_name_unseelie_petitioners
    
		per_attribute = {
			name = intrigue
			value = 0.5
		}
		has_trait = {
			trait = ambitious
			value = 5
		}
		has_trait = {
			trait = genius
			value = 4
		}
		has_trait = {
			trait = quick
			value = 3
		}
		has_trait = {
			trait = shrewd
			value = 3
		}
		has_trait = {
			trait = hedonist
			value = 3
		}
		has_trait = {
			trait = mystic
			value = 3
		}
		has_trait = {
			trait = seducer
			value = 3
		}
		has_trait = {
			trait = seductress
			value = 3
		}
		has_trait = {
			trait = schemer
			value = 3
		}
		has_trait = {
			trait = impaler
			value = 3
		}
		has_trait = {
			trait = lustful
			value = 1
		}
		has_trait = {
			trait = proud
			value = 1
		}
		has_trait = {
			trait = greedy
			value = 1
		}
		has_trait = {
			trait = deceitful
			value = 1
		}
		has_trait = {
			trait = arbitrary
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			trait = ambitious
			factor = 1.5
		}
		modifier = {
			trait = genius
			factor = 1.3
		}
		modifier = {
			trait = quick
			factor = 1.3
		}
		modifier = {
			trait = shrewd
			factor = 1.3
		}
		modifier = {
			trait = hedonist
			factor = 1.3
		}
		modifier = {
			trait = mystic
			factor = 1.3
		}
		modifier = {
			trait = seducer
			factor = 1.3
		}
		modifier = {
			trait = seductress
			factor = 1.3
		}
		modifier = {
			trait = schemer
			factor = 1.3
		}
		modifier = {
			trait = impaler
			factor = 1.3
		}
		modifier = {
			trait = lustful
			factor = 1.1
		}
		modifier = {
			trait = proud
			factor = 1.1
		}
		modifier = {
			trait = greedy
			factor = 1.1
		}
		modifier = {
			trait = deceitful
			factor = 1.1
		}
		modifier = {
			trait = arbitrary
			factor = 1.1
		}
	}
	
	startup_populate = {
		trigger = {
			NAND = {
				ai = yes
				trait = full_cybernetic_conversion
			}
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
	    	controls_religion = no 
		   	has_unseelie_prerequisites = yes
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
		}
	}
}

the_coven = {
	primary_attribute = intrigue
	is_secret = yes
	criminal = yes
	devil_worshipper = yes
	opinion_to_other_members = +5
	opinion_to_pretenders = -40			#Pretenders is the opinion you have of people perceived/discovered to be in your society.
	opinion_to_perceived_members = -40	#Perceived is the opinion you have of people perceived/discovered to be of a society you're not part of
	opinion_per_rank_above = +10
	sound = devil_worshippers_interface
	society_ranks_gfx = devil_ranks
	
	active = {
		has_dlc = "Mystics"
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
	}
	indestructible = yes
	
	can_join_society = {
		NAND = {
			ai = yes
			trait = full_cybernetic_conversion
		}		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_coven
					rank = 1
				}
			}
		}
		has_coven_prerequisites = yes
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}
	
	show_society = {
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
		age = 16
		OR = {
			religion = promethean_pagan
			religion = titan_pagan
			secret_religion = promethean_pagan
			secret_religion = titan_pagan
			society_member_of = the_coven
		}
	}
	
	potential = { } #no rules
	
	society_rank = {
		level = 1
		limit = 100 
		startup_limit = 10
		decisions = {
			prisoner_dark_sacrifice #Available Decision: Sacrifice Prisoner
			#Over time, lose virtues, gain vices. A Soul Corruption-effect is on a yearly pulse (with a chance to do nothing)
		}
	}
	
	society_rank = { 
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_coven
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 1
		}
		decisions = {
			devil_worshipers_summon_familiar #Available Power: Summon Familiar
			the_devil_worshipers_tainted_touch #Available Power: Curse people with disease
			devil_worshipers_demonic_possession #Available Power: Possess someone to make fanatically loyal
			#Available Power: Abduction plot
			#unlock new options in Seduction and Spy On?
		}
	}
	
	society_rank = {
		level = 3
		limit = 25 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = the_coven
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 2
		}
		decisions = {
			devil_worshipers_dark_divorce #Available Power: Dark Divorce
			devil_worshipers_dark_healing #Available Power: Demonic Healing. Sacrifice a prisoner to heal a random illness or maiming.
			devil_worshipers_invite_disciple_of_devil #Available Decision: Invite a witch to court
			#Available Power: Love Potion
		}
	}

	society_rank = {
		level = 4
		limit = 1 
		startup_limit = 1
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_coven
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 3
		}
		decisions = {
			DW_prolong_life #Available Power: Prolong Life
			DW_demonic_impregnation #Available power: Unholy Impregnation
		}
		obedience_tooltip = obedience_tooltip #this can be unique per rank/society 
		obedient = {
			ROOT = {
				always = yes
			}
		}		
	}

	plots = {
		plot1_tag
		plot2_tag
	}
    
	ambitions = {
		ambition1_tag
		ambition2_tag
	}

	monthly_currency_gain = {
		name = currency_name_the_coven
    
		per_attribute = {
			name = intrigue
			value = 0.5
		}
		has_trait = {
			trait = ambitious
			value = 5
		}
		has_trait = {
			trait = genius
			value = 4
		}
		has_trait = {
			trait = quick
			value = 3
		}
		has_trait = {
			trait = shrewd
			value = 3
		}
		has_trait = {
			trait = hedonist
			value = 3
		}
		has_trait = {
			trait = mystic
			value = 3
		}
		has_trait = {
			trait = seducer
			value = 3
		}
		has_trait = {
			trait = seductress
			value = 3
		}
		has_trait = {
			trait = schemer
			value = 3
		}
		has_trait = {
			trait = impaler
			value = 3
		}
		has_trait = {
			trait = lustful
			value = 1
		}
		has_trait = {
			trait = proud
			value = 1
		}
		has_trait = {
			trait = greedy
			value = 1
		}
		has_trait = {
			trait = deceitful
			value = 1
		}
		has_trait = {
			trait = arbitrary
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			trait = ambitious
			factor = 1.5
		}
		modifier = {
			trait = genius
			factor = 1.3
		}
		modifier = {
			trait = quick
			factor = 1.3
		}
		modifier = {
			trait = shrewd
			factor = 1.3
		}
		modifier = {
			trait = hedonist
			factor = 1.3
		}
		modifier = {
			trait = mystic
			factor = 1.3
		}
		modifier = {
			trait = seducer
			factor = 1.3
		}
		modifier = {
			trait = seductress
			factor = 1.3
		}
		modifier = {
			trait = schemer
			factor = 1.3
		}
		modifier = {
			trait = impaler
			factor = 1.3
		}
		modifier = {
			trait = lustful
			factor = 1.1
		}
		modifier = {
			trait = proud
			factor = 1.1
		}
		modifier = {
			trait = greedy
			factor = 1.1
		}
		modifier = {
			trait = deceitful
			factor = 1.1
		}
		modifier = {
			trait = arbitrary
			factor = 1.1
		}
	}
	
	startup_populate = {
		trigger = {
			NAND = {
				ai = yes
				trait = full_cybernetic_conversion
			}
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
	    	controls_religion = no 
		    has_coven_prerequisites = yes
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
		}
	}
}

the_sand_snakes = {
	primary_attribute = intrigue
	is_secret = yes
	criminal = yes
	devil_worshipper = yes
	opinion_to_other_members = +5
	opinion_to_pretenders = -40			#Pretenders is the opinion you have of people perceived/discovered to be in your society.
	opinion_to_perceived_members = -40	#Perceived is the opinion you have of people perceived/discovered to be of a society you're not part of
	opinion_per_rank_above = +10
	sound = devil_worshippers_interface
	society_ranks_gfx = devil_ranks
	
	active = {
		has_dlc = "Mystics"
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
	}
	indestructible = yes
	
	can_join_society = {
		NAND = {
			ai = yes
			trait = full_cybernetic_conversion
		}		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_sand_snakes
					rank = 1
				}
			}
		}
		has_sand_snakes_prerequisites = yes
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}
	
	show_society = {
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
		age = 16
		OR = {
			religion_openly_in_egyptian_subgroup_trigger = yes
			religion_secretly_in_egyptian_subgroup_trigger = yes
			society_member_of = the_sand_snakes
		}
	}
	
	potential = { } #no rules
	
	society_rank = {
		level = 1
		limit = 100 
		startup_limit = 10
		decisions = {
			prisoner_dark_sacrifice #Available Decision: Sacrifice Prisoner
			#Over time, lose virtues, gain vices. A Soul Corruption-effect is on a yearly pulse (with a chance to do nothing)
		}
	}
	
	society_rank = { 
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_sand_snakes
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 1
		}
		decisions = {
			devil_worshipers_summon_familiar #Available Power: Summon Familiar
			the_devil_worshipers_tainted_touch #Available Power: Curse people with disease
			devil_worshipers_demonic_possession #Available Power: Possess someone to make fanatically loyal
			#Available Power: Abduction plot
			#unlock new options in Seduction and Spy On?
		}
	}
	
	society_rank = {
		level = 3
		limit = 25 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = the_sand_snakes
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 2
		}
		decisions = {
			devil_worshipers_dark_divorce #Available Power: Dark Divorce
			devil_worshipers_dark_healing #Available Power: Demonic Healing. Sacrifice a prisoner to heal a random illness or maiming.
			devil_worshipers_invite_disciple_of_devil #Available Decision: Invite a witch to court
			#Available Power: Love Potion
		}
	}

	society_rank = {
		level = 4
		limit = 1 
		startup_limit = 1
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_sand_snakes
					FROM = { is_society_discovered = yes }
				}
			}
			intrigue = 3
		}
		decisions = {
			DW_prolong_life #Available Power: Prolong Life
			DW_demonic_impregnation #Available power: Unholy Impregnation
		}
		obedience_tooltip = obedience_tooltip #this can be unique per rank/society 
		obedient = {
			ROOT = {
				always = yes
			}
		}		
	}

	plots = {
		plot1_tag
		plot2_tag
	}
    
	ambitions = {
		ambition1_tag
		ambition2_tag
	}

	monthly_currency_gain = {
		name = currency_name_the_sand_snakes
    
		per_attribute = {
			name = intrigue
			value = 0.5
		}
		has_trait = {
			trait = ambitious
			value = 5
		}
		has_trait = {
			trait = genius
			value = 4
		}
		has_trait = {
			trait = quick
			value = 3
		}
		has_trait = {
			trait = shrewd
			value = 3
		}
		has_trait = {
			trait = hedonist
			value = 3
		}
		has_trait = {
			trait = mystic
			value = 3
		}
		has_trait = {
			trait = seducer
			value = 3
		}
		has_trait = {
			trait = seductress
			value = 3
		}
		has_trait = {
			trait = schemer
			value = 3
		}
		has_trait = {
			trait = impaler
			value = 3
		}
		has_trait = {
			trait = lustful
			value = 1
		}
		has_trait = {
			trait = proud
			value = 1
		}
		has_trait = {
			trait = greedy
			value = 1
		}
		has_trait = {
			trait = deceitful
			value = 1
		}
		has_trait = {
			trait = arbitrary
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			trait = ambitious
			factor = 1.5
		}
		modifier = {
			trait = genius
			factor = 1.3
		}
		modifier = {
			trait = quick
			factor = 1.3
		}
		modifier = {
			trait = shrewd
			factor = 1.3
		}
		modifier = {
			trait = hedonist
			factor = 1.3
		}
		modifier = {
			trait = mystic
			factor = 1.3
		}
		modifier = {
			trait = seducer
			factor = 1.3
		}
		modifier = {
			trait = seductress
			factor = 1.3
		}
		modifier = {
			trait = schemer
			factor = 1.3
		}
		modifier = {
			trait = impaler
			factor = 1.3
		}
		modifier = {
			trait = lustful
			factor = 1.1
		}
		modifier = {
			trait = proud
			factor = 1.1
		}
		modifier = {
			trait = greedy
			factor = 1.1
		}
		modifier = {
			trait = deceitful
			factor = 1.1
		}
		modifier = {
			trait = arbitrary
			factor = 1.1
		}
	}
	
	startup_populate = {
		trigger = {
			NAND = {
				ai = yes
				trait = full_cybernetic_conversion
			}
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
	    	controls_religion = no 
		    has_sand_snakes_prerequisites = yes
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
		}
	}
}

## Other Secret Societies ##
shezmu_cult = {
	primary_attribute = intrigue
	is_secret = yes
	criminal = yes
	devil_worshipper = no
	opinion_to_other_members = +10
	opinion_to_pretenders = -20			#Pretenders is the opinion you have of people perceived/discovered to be in your society.
	opinion_to_perceived_members = -20 	#Perceived is the opinion you have of people perceived/discovered to be of a society you're not part of
	opinion_per_rank_above = +10
	society_rank_up_decision = request_to_rank_up_within_society
	sound = assassins_interface
	society_ranks_gfx = generic_ranks
	society_influence = no
	
	active = {
		has_dlc = "Mystics"
		has_global_flag = egyptian_reformation
		has_global_flag = ancrel_debug
	}

	indestructible = yes

	can_join_society = {
		NAND = {
			ai = yes
			trait = full_cybernetic_conversion
		}		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = shezmu_cult
					rank = 1
				}
			}
		}
		age = 16
		NOR = {
			trait = decadent
			trait = arbitrary
		}
		OR = {
			is_female = no
			has_game_rule = {
				name = gender
				value = all
			}
			has_religion_feature = religion_matriarchal
			has_religion_feature = religion_equal
		}
		OR = {
			is_female = yes
			NOT = {
				has_religion_feature = religion_matriarchal	
			}
		}
		OR = {
			religion_openly_in_egyptian_subgroup_trigger = yes
			religion_secretly_in_egyptian_subgroup_trigger = yes
			AND = {
				trait = sympathy_pagans
				trait = just
				NOT = { trait = zealous }
				OR = {
					trait = schemer
					trait = elusive_shadow
					intrigue = 18
				}
			}
			#AND = {
			#	ai = no
			#	NOT = { trait = zealous }
			#	any_playable_ruler = {
			#		religion_openly_in_egyptian_subgroup_trigger = yes
			#		NOT = {
			#			distance_from_realm = { value = 300 who = ROOT }
			#		}
			#	}
			#}
		}
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
		trigger_if = {
			limit = { prisoner = yes }
			prisoner = no
		}
	}

	show_society = {
		OR = {
			society_member_of = shezmu_cult #You can always see the society you are a part of
			AND = {
				OR = {
					religion_openly_in_egyptian_subgroup_trigger = yes
					religion_secretly_in_egyptian_subgroup_trigger = yes
				}
				age = 16
			}
		}
	}

	potential = {
		has_shezmu_prerequisites = yes
	}

	society_rank = {
		level = 1
		limit = 50 
		startup_limit = 10
		modifier = {
			is_visible = {
				OR = {
					society_member_of = shezmu_cult
					FROM = { is_society_discovered = yes }
				}
			}
			murder_plot_power_modifier = 0.1 # increased plotpower
		}
		decisions = {
			decision_abduct
			assassins_borrow_money
			assassins_donate
			assassins_drug_effect
		}
	}
	
	society_rank = {
		level = 2
		limit = 30
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = shezmu_cult
					FROM = { is_society_discovered = yes }
				}
			}
			murder_plot_power_modifier = 0.2 # further increased plotpower
			defensive_plot_power_modifier = 0.1
			intrigue = 1 
			combat_rating = 10 # bonus to dueling
		}
		decisions = {
			assassins_scare_ruler #Available (targeted) Power: Can scare rulers to get a Favor (leave a dagger on their pillow, etc. 
		}
	}
	
	society_rank = {
		level = 3
		limit = 20 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = shezmu_cult
					FROM = { is_society_discovered = yes }
				}
			}
			murder_plot_power_modifier = 0.30 # further increased plotpower
			defensive_plot_power_modifier = 0.15
			intrigue = 2 # further increase
			combat_rating = 10 # bonus to dueling (left over)
			plot_discovery_chance = 0.1 # bonus to plot discovery chance
		}
		decisions = {
			assassins_raise_ships #Available Power: Can raise special fleet of Ships
		}
	}

	society_rank = {
		level = 4
		limit = 1 
		startup_limit = 1
		modifier = {
			is_visible = {
				OR = {
					society_member_of = shezmu_cult
					FROM = { is_society_discovered = yes }
				}
			}
			murder_plot_power_modifier = 0.50 # further increased plotpower
			defensive_plot_power_modifier = 0.25
			intrigue = 3 # further increase
			combat_rating = 10 # bonus to dueling (left over)
			plot_discovery_chance = 0.2 # further bonus to plot discovery chance
		}
		decisions = {
			assassins_raise_troops #Available Power: Can raise a special regiment
			assassins_mark_for_death #Available (targeted) Power: Mark for death (+ assassins_clear_marked_for_death_target i.e. the clearing of the mark)
		}
		obedience_tooltip = obedience_tooltip #this can be unique per rank/society 
		obedient = {
			ROOT = {
				always = yes
			}
		}
	}

	monthly_currency_gain = {
		name = currency_name_shezmu_cult
    
		per_attribute = {
			name = intrigue 
			value = 0.5
		}
		has_trait = {
			trait = just
			value = 5
		}
		has_trait = {
			trait = zealous
			value = 3
		}
		has_trait = {
			trait = erudite
			value = 3
		}
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = theologian
			value = 3
		}
		has_trait = {
			trait = schemer
			value = 3
		}
		has_trait = {
			trait = strong
			value = 1
		}
		has_trait = {
			trait = robust
			value = 1
		}
		has_trait = {
			trait = genius
			value = 1
		}
		has_trait = {
			trait = quick
			value = 1
		}
		has_trait = {
			trait = shrewd
			value = 1
		}
		has_trait = {
			trait = diligent
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			trait = just
			factor = 1.3
		}
		modifier = {
			trait = zealous
			factor = 1.3
		}
		modifier = {
			trait = erudite
			factor = 1.3
		}
		modifier = {
			trait = scholar
			factor = 1.3
		}
		modifier = {
			trait = theologian
			factor = 1.3
		}
		modifier = {
			trait = schemer
			factor = 1.3
		}
		modifier = {
			trait = strong
			factor = 1.1
		}
		modifier = {
			trait = robust
			factor = 1.1
		}
		modifier = {
			trait = genius
			factor = 1.1
		}
		modifier = {
			trait = quick
			factor = 1.1
		}
		modifier = {
			trait = shrewd
			factor = 1.1
		}
		modifier = {
			trait = diligent
			factor = 1.1
		}
		modifier = {
			trait = patient
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}	
	}
	
	startup_populate = {
		trigger = {
			NAND = {
				ai = yes
				trait = full_cybernetic_conversion
			}
			ai = yes
	    	controls_religion = no 
			has_shezmu_prerequisites = yes
			OR = {
				is_female = no
				has_game_rule = {
					name = gender
					value = all
				}
				has_religion_feature = religion_matriarchal
			}
			OR = {
				is_female = yes
				NOT = {
					has_religion_feature = religion_matriarchal	
				}
			}
			NOR = {
				trait = decadent
				trait = arbitrary
			}
			OR = {
				trait = zealous
				trait = schemer
				trait = elusive_shadow
				trait = just
				trait = ambitious
				intrigue = 18
			}
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOT = { mercenary = yes }
			NOT = { holy_order = yes }
		}
	}
}

mysteries_dionysus = {
	primary_attribute = diplomacy
	is_secret = yes
	criminal = no
	devil_worshipper = no
	opinion_to_other_members = +5
	opinion_to_pretenders = -10			#Pretenders is the opinion you have of people perceived/discovered to be in your society.
	opinion_to_perceived_members = 0	#Perceived is the opinion you have of people perceived/discovered to be of a society you're not part of
	opinion_per_rank_above = +10
	sound = secret_cults_interface # placeholder
	society_ranks_gfx = secret_ranks # placeholder
	
	active = { 
		has_dlc = "The Old Gods"
		has_global_flag = ancrel_debug
	}

	indestructible = yes
	
	can_join_society = {
		NAND = {
			ai = yes
			trait = full_cybernetic_conversion
		}		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = mysteries_dionysus
					rank = 1
				}
			}
		}
		has_dionysus_prerequisites = yes
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}
	
	show_society = {
		age = 16
		has_dionysus_prerequisites = yes
		has_global_flag = ancrel_debug
	}
	
	potential = { } # no rules
	
	society_rank = { # initiate
		level = 1
		limit = 100 
		startup_limit = 10
		decisions = {
			build_winery
		}
	}
	
	society_rank = { # hymnodidaskaloi/"hymn teacher"
		level = 2
		limit = 11
		startup_limit = 3
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = mysteries_dionysus
					FROM = { is_society_discovered = yes }
				}
			}
			diplomacy = 1
		}
		decisions = {
			hold_tristeria	# secret rites
		}
	}
	
	society_rank = { # boukolos/cowherd
		level = 3
		limit = 7
		startup_limit = 2
		modifier = {
			is_visible = {
				OR = {
					society_member_of = mysteries_dionysus
					FROM = { is_society_discovered = yes }
				}
			}
			diplomacy = 2
		}
		decisions = {
			hold_dionysia # public rites
		}
	}

	society_rank = { # archiboukolos/"chief cowherd"
		level = 4
		limit = 3
		startup_limit = 1
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = mysteries_dionysus
					FROM = { is_society_discovered = yes }
				}
			}
			diplomacy = 3
		}
		decisions = {

		}
	}

	monthly_currency_gain = {
		name = currency_name_mysteries_dionysus
    
		per_attribute = {
			name = diplomacy
			value = 1
		}
		has_trait = {
			trait = possessed
			value = 5
		}
		has_trait = {
			trait = genius
			value = 4
		}
		has_trait = {
			trait = quick
			value = 3
		}
		has_trait = {
			trait = shrewd
			value = 3
		}
		has_trait = {
			trait = hedonist
			value = 3
		}
		has_trait = {
			trait = mystic
			value = 3
		}
		has_trait = {
			trait = seducer
			value = 3
		}
		has_trait = {
			trait = seductress
			value = 3
		}
		has_trait = {
			trait = socializer
			value = 3
		}
		has_trait = {
			trait = drunkard
			value = 2
		}
		has_trait = {
			trait = lustful
			value = 1
		}
		has_trait = {
			trait = gluttonous
			value = 1
		}
		has_trait = {
			trait = arbitrary
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			trait = possessed
			factor = 1.4
		}
		modifier = {
			trait = genius
			factor = 1.3
		}
		modifier = {
			trait = quick
			factor = 1.3
		}
		modifier = {
			trait = shrewd
			factor = 1.3
		}
		modifier = {
			trait = hedonist
			factor = 1.3
		}
		modifier = {
			trait = mystic
			factor = 1.3
		}
		modifier = {
			trait = seducer
			factor = 1.3
		}
		modifier = {
			trait = seductress
			factor = 1.3
		}
		modifier = {
			trait = socializer
			factor = 1.3
		}
		modifier = {
			trait = drunkard
			factor = 1.2
		}
		modifier = {
			trait = lustful
			factor = 1.1
		}
		modifier = {
			trait = gluttonous
			factor = 1.1
		}
		modifier = {
			trait = arbitrary
			factor = 1.1
		}
	}
	
	startup_populate = {
		trigger = {
			NAND = {
				ai = yes
				trait = full_cybernetic_conversion
			}
			ai = yes
	    	controls_religion = no 
		    has_dionysus_prerequisites = yes
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
		}
	}
}
