#Devil Worshipers
the_cursed_house = { #Basicly The Sixht House
	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
	society_influence = no
	
	active = {
		has_dlc = "Mystics"
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
	}
	indestructible = yes
	
	can_join_society = {
		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_cursed_house
					rank = 1
				}
			}
		}
		religion_openly_dwemer_or_dunmer_trigger = yes
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
		trigger_if = {
			limit = { prisoner = yes }
			prisoner = no
		}
	}

	show_society = {
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
		age = 16
		OR = {
			religion = dwarven_dwemer
			religion = dwarven_dwemer_heresy
			religion = elven_tribunal
			religion = elven_tribunal_heresy
			society_member_of = the_cursed_house
		}
	}

	potential = { } #no rules

	society_rank = {
		level = 1
		limit = 100 
		startup_limit = 10
		decisions = {
			decision_abduct
			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)
		}
		
		#custom_tooltip = unlockable_DW_powers_at_rank_2;
	}
	
	society_rank = {
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_cursed_house
					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?
		}
		
		#custom_tooltip = unlockable_DW_powers_at_rank_3;
	}
	
	society_rank = {
		level = 3
		limit = 25 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = the_cursed_house
					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
		}
		
		#custom_tooltip = unlockable_DW_powers_at_rank_4;
	}

	society_rank = {
		level = 4
		limit = 1 
		startup_limit = 1
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_cursed_house
					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_satanists
    
		per_attribute = {
			name = intrigue
			value = 0.5
		}
	triggered_gain = {
			desc = loc_is_revealed_antichrist
			trigger = { has_character_modifier = demon_horns
			}
			value = 10
		}
		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
		}
		has_trait = {
			trait = baptized_by_satan
			value = 5
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			has_character_modifier = demon_horns
			factor = 2
		}
		modifier = {
			trait = baptized_by_satan
			factor = 1.75
		}
		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 = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
			controls_religion = no
			OR = { 
			    religion_openly_dwemer_or_dunmer_trigger = yes
			}
			OR = {
				has_impious_trait_trigger = yes
				has_vice_trigger = yes
				trait = drunkard
				trait = possessed
				trait = lunatic
			}
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
		}
	}
}

######

the_cult_of_excess = { #Basicly The Cult of Excess from Warhammer Fantasy
	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
	society_influence = no
	
	active = {
		has_dlc = "Mystics"
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
	}
	indestructible = yes
	
	can_join_society = {
		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_cult_of_excess
					rank = 1
				}
			}
		}
		has_the_cult_of_excess_prerequisites = yes
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
		trigger_if = {
			limit = { prisoner = yes }
			prisoner = no
		}
	}

	show_society = {
		NOT = {
			has_game_rule = {
				name = devil_worshipers
				value = none
			}
		}
		age = 16
		OR = {
			religion = elven
			religion = elven_heresy
			society_member_of = the_cult_of_excess
		}
	}

	potential = { } #no rules

	society_rank = {
		level = 1
		limit = 100 
		startup_limit = 10
		decisions = {
			decision_abduct
			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)
		}
		
		#custom_tooltip = unlockable_DW_powers_at_rank_2;
	}
	
	society_rank = {
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_cult_of_excess
					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?
		}
		
		#custom_tooltip = unlockable_DW_powers_at_rank_3;
	}
	
	society_rank = {
		level = 3
		limit = 25 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = the_cult_of_excess
					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
		}
		
		#custom_tooltip = unlockable_DW_powers_at_rank_4;
	}

	society_rank = {
		level = 4
		limit = 1 
		startup_limit = 1
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_cult_of_excess
					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_satanists
    
		per_attribute = {
			name = intrigue
			value = 0.5
		}
	triggered_gain = {
			desc = loc_is_revealed_antichrist
			trigger = { has_character_modifier = demon_horns
			}
			value = 10
		}
		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
		}
		has_trait = {
			trait = baptized_by_satan
			value = 5
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			has_character_modifier = demon_horns
			factor = 2
		}
		modifier = {
			trait = baptized_by_satan
			factor = 1.75
		}
		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 = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
			controls_religion = no
			OR = { 
			    has_the_cult_of_excess_prerequisites = yes
			}
			OR = {
				has_impious_trait_trigger = yes
				has_vice_trigger = yes
				trait = drunkard
				trait = possessed
				trait = lunatic
			}
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
		}
	}
}

######

dark_elven_assassins = { #Basicly Morag Tong/Dark Brotherhood
	primary_attribute = intrigue
	is_secret = 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"
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = dark_elven_assassins
					rank = 1
				}
			}
		}
		age = 16
		OR = {
			true_religion = elven_tribunal
			religion_group = otherworlden
			AND = {
#				trait = sympathy_islam
				trait = deceitful
				NOT = { trait = zealous }
				OR = {
					trait = schemer
					trait = elusive_shadow
					intrigue = 18
				}
			}
			AND = {
				ai = no
				NOT = { trait = zealous }
				any_playable_ruler = {
					religion = elven_tribunal
					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 = dark_elven_assassins #You can always see the society you are a part of
			AND = {
				OR = {
					religion_group = otherworlden
					secret_religion = elven_tribunal
					AND = {
						ai = no
						NOT = { trait = zealous }
						any_playable_ruler = {
							religion = elven_tribunal
							NOT = {
								distance_from_realm = { value = 300 who = ROOT }
							}
						}
					}
				}
				age = 16
				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	
					}
				}
			}
		}
	}

	potential = {
		OR = {
			religion = elven_tribunal
			secret_religion = elven_tribunal
		}
	}

	society_rank = {
		level = 1
		limit = 20 
		startup_limit = 10
		modifier = {
			is_visible = {
				OR = {
					society_member_of = dark_elven_assassins
					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 = 15
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = dark_elven_assassins
					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 = 5 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = dark_elven_assassins
					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 = dark_elven_assassins
					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_dark_elven_assassins
    
		per_attribute = {
			name = intrigue 
			value = 0.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 = {
			primary_title = { title = d_hashshashin }
			factor = 2
		}
		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 = {
			ai = yes
	    	controls_religion = no 
			religion = elven_tribunal
			age = 16
			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	
				}
			}
			NOT = { trait = decadent }
			OR = {
				trait = zealous
				trait = schemer
				trait = elusive_shadow
				trait = deceitful
				trait = ambitious
				intrigue = 18
			}
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOT = { mercenary = yes }
            NOT = { holy_order = yes }
		}
	}
}