###MONASTIC ORDER###
monastic_order_benedictine = {
	primary_attribute = stewardship
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_benedictine
					rank = 1
				}
			}
		}
		age = 16
		OR = {
			religion = catholic
			AND = {
				is_heretic = no
				OR = {
					religion = chalcedonian
					religion = fraticelli
					religion = waldensian
					religion = lollard
					religion = cathar
					religion = adoptionist
				}
			}
		}
		NOT = { trait = excommunicated }
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_benedictine }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}
	
	show_society = {
		OR = {
			religion = catholic
			AND = {
				is_heretic = no
				OR = {
					religion = chalcedonian
					religion = fraticelli
					religion = waldensian
					religion = lollard
					religion = cathar
					religion = adoptionist
				}
			}
			society_member_of = monastic_order_benedictine
		}
	}
	
	potential = {
		OR = {
			religion = catholic
			AND = {
				is_heretic = no
				OR = {
					religion = chalcedonian
					religion = fraticelli
					religion = waldensian
					religion = lollard
					religion = cathar
					religion = adoptionist
				}
			}
		}
	}
	
	society_rank = {
		level = 1
		limit = 100 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = monastic_order_education_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			stewardship = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 25 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			stewardship = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			stewardship = 3
			build_cost_temple_modifier = -0.5 
			fertility = -0.15
		}
		decisions = {
			monastic_order_convert_county
		}
		custom_tooltip = benedictine_power_diligent_tt
	}

	monthly_currency_gain = {
		name = currency_name_monastic_order_benedictine
    	
    	per_attribute = {
    		name = stewardship
    		value = 0.5
    	}
		has_trait = {
			trait = paragon
			value = 5
		}
    	has_trait = {
			trait = monk
			value = 5
		}
		has_trait = {
			trait = nun
			value = 5
		}
		has_trait = {
			trait = diligent
			value = 3
		}
		has_trait = {
			trait = celibate
			value = 3
		}
    	has_trait = {
			trait = chaste
			value = 3
		}
		has_trait = {
			trait = temperate
			value = 3
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = kind
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = zealous
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = erudite
			value = 1
		}
		has_trait = {
			trait = pilgrim
			value = 1
		}
		has_trait = {
			trait = theologian
			value = 1
		}
		has_trait = {
			trait = gardener
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			is_priest = yes
			factor = 10
		}
		modifier = {
			trait = monk
			factor = 5
		}
		modifier = {
			trait = nun
			factor = 5
		}
		modifier = {
			trait = diligent
			factor = 1.3
		}
		modifier = {
			trait = celibate
			factor = 1.3
		}
    	modifier = {
			trait = chaste
			factor = 1.3
		}
		modifier = {
			trait = temperate
			factor = 1.3
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = kind
			factor = 1.1
		}
		modifier = {
			trait = patient
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = zealous
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
		modifier = {
			trait = erudite
			factor = 1.1
		}
		modifier = {
			trait = pilgrim
			factor = 1.1
		}
		modifier = {
			trait = theologian
			factor = 1.1
		}
		modifier = {
			trait = gardener
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
			OR = {
				religion = chalcedonian
				religion = catholic
			}
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			NOT = { trait = excommunicated }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = gardener
				trait = monk
				trait = nun
				learning = 16
				is_priest = yes
			}
		}
	}
}

monastic_order_dominican = {
	primary_attribute = learning
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
		k_papal_state = {
			has_holder = yes
		}
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_dominican
					rank = 1
				}
			}
		}
		age = 16
		religion = catholic
		NOT = { trait = excommunicated }
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_dominican }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion = catholic
			society_member_of = monastic_order_dominican
		}
	}

	potential = { religion = catholic }

	society_rank = {
		level = 1
		limit = 100 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = monastic_order_education_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			learning = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 25 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			learning = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5 
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			learning = 3
			build_cost_temple_modifier = -0.5
			fertility = -0.15
		}
		decisions = {
			monastic_order_convert_county
		}
	}

	monthly_currency_gain = {
		name = currency_name_monastic_order_dominican
    	
    	per_attribute = {
    		name = learning
    		value = 0.5
    	}
		has_trait = {
			trait = paragon
			value = 5
		}
    	has_trait = {
			trait = monk
			value = 5
		}
		has_trait = {
			trait = nun
			value = 5
		}
		has_trait = {
			trait = zealous
			value = 3
		}
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = theologian
			value = 3
		}	
		has_trait = {
			trait = celibate
			value = 2
		}
		has_trait = {
			trait = diligent
			value = 1
		}
    	has_trait = {
			trait = chaste
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = kind
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = erudite
			value = 1
		}
		has_trait = {
			trait = pilgrim
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			is_priest = yes
			factor = 10
		}
		modifier = {
			trait = monk
			factor = 5
		}
		modifier = {
			trait = nun
			factor = 5
		}
		modifier = {
			trait = zealous
			factor = 1.3
		}
		modifier = {
			trait = scholar
			factor = 1.3
		}
		modifier = {
			trait = theologian
			factor = 1.3
		}
		modifier = {
			trait = celibate
			factor = 1.2
		}
		modifier = {
			trait = diligent
			factor = 1.2
		}
    	modifier = {
			trait = chaste
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = kind
			factor = 1.1
		}
		modifier = {
			trait = patient
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
		modifier = {
			trait = erudite
			factor = 1.1
		}
		modifier = {
			trait = pilgrim
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			k_papal_state = {
				has_holder = yes
			}
			ai = yes
	    	controls_religion = no
		   	religion = catholic
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			NOT = { trait = excommunicated }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = monk
				trait = nun
				learning = 16
				is_priest = yes
			}
		}
	}
}


monastic_order_orthodox = {
	primary_attribute = learning
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
		k_papal_state = {
			has_holder = yes
		}
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_orthodox
					rank = 1
				}
			}
		}
		age = 16
		OR = {
			religion = orthodox
			AND = {
				is_heretic = no
				OR = {
					religion = bogomilist
					religion = monothelite
					religion = iconoclast
				}
			}
		}
		NOT = { trait = excommunicated }
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_orthodox }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion = orthodox
			AND = {
				is_heretic = no
				OR = {
					religion = bogomilist
					religion = monothelite
					religion = iconoclast
				}
			}
			society_member_of = monastic_order_orthodox
		}
	}

	potential = {
		OR = {
			religion = orthodox
			AND = {
				is_heretic = no
				OR = {
					religion = bogomilist
					religion = monothelite
					religion = iconoclast
				}
			}
		}
	}

	society_rank = {
		level = 1
		limit = 50 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = monastic_order_education_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 20
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			learning = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 10 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			learning = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			temple_vassal_tax_modifier = 0.1
			learning = 3
			build_cost_temple_modifier = -0.5
			fertility = -0.15
		}
		decisions = {
			monastic_order_convert_county
		}
	}
    
	monthly_currency_gain = {
		name = currency_name_monastic_order_orthodox
    	
    	per_attribute = {
    		name = learning
    		value = 0.5
    	}
		has_trait = {
			trait = paragon
			value = 5
		}
    	has_trait = {
			trait = monk
			value = 5
		}
		has_trait = {
			trait = nun
			value = 5
		}
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = theologian
			value = 3
		}	
		has_trait = {
			trait = celibate
			value = 2
		}
		has_trait = {
			trait = diligent
			value = 1
		}
    	has_trait = {
			trait = chaste
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = kind
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = erudite
			value = 1
		}
		has_trait = {
			trait = pilgrim
			value = 1
		}
		has_trait = {
			trait = zealous
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			is_priest = yes
			factor = 10
		}
		modifier = {
			trait = monk
			factor = 5
		}
		modifier = {
			trait = nun
			factor = 5
		}
		modifier = {
			trait = scholar
			factor = 1.3
		}
		modifier = {
			trait = theologian
			factor = 1.3
		}
		modifier = {
			trait = celibate
			factor = 1.2
		}
		modifier = {
			trait = diligent
			factor = 1.2
		}
    	modifier = {
			trait = chaste
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = kind
			factor = 1.1
		}
		modifier = {
			trait = patient
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
		modifier = {
			trait = erudite
			factor = 1.1
		}
		modifier = {
			trait = pilgrim
			factor = 1.1
		}
		modifier = {
			trait = zealous
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			k_papal_state = {
				has_holder = yes
			}
			ai = yes
	    	controls_religion = no
		   	religion = orthodox
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			NOT = { trait = excommunicated }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = monk
				trait = nun
				learning = 16
				is_priest = yes
			}
		}
	}
}

monastic_order_nestorian = {
	primary_attribute = learning
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_nestorian
					rank = 1
				}
			}
		}
		age = 16
		OR = {
			religion = nestorian
			AND = {
				is_heretic = no
				religion = messalian
			}
		}
		NOT = { trait = excommunicated }
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_nestorian }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion = nestorian
			AND = {
				is_heretic = no
				religion = messalian
			}
			society_member_of = monastic_order_nestorian
		}
	}

	potential = {
		OR = {
			religion = nestorian
			AND = {
				is_heretic = no
				religion = messalian
			}
		}
	}

	society_rank = {
		level = 1
		limit = 50 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = monastic_order_education_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 20
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			learning = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 10 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			learning = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			temple_vassal_tax_modifier = 0.1
			build_cost_temple_modifier = -0.5
			learning = 3
			fertility = -0.15
		}
		decisions = {
			monastic_order_convert_county
		}
	}

	monthly_currency_gain = {
		name = currency_name_monastic_order_nestorian

		per_attribute = {
    		name = learning
    		value = 0.5
    	}
		has_trait = {
			trait = paragon
			value = 5
		}
    	has_trait = {
			trait = monk
			value = 5
		}
		has_trait = {
			trait = nun
			value = 5
		}
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = theologian
			value = 3
		}	
		has_trait = {
			trait = celibate
			value = 2
		}
		has_trait = {
			trait = diligent
			value = 1
		}
    	has_trait = {
			trait = chaste
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = kind
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = erudite
			value = 1
		}
		has_trait = {
			trait = pilgrim
			value = 1
		}
		has_trait = {
			trait = zealous
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			is_priest = yes
			factor = 10
		}
		modifier = {
			trait = monk
			factor = 5
		}
		modifier = {
			trait = nun
			factor = 5
		}
		modifier = {
			trait = scholar
			factor = 1.3
		}
		modifier = {
			trait = theologian
			factor = 1.3
		}
		modifier = {
			trait = celibate
			factor = 1.2
		}
		modifier = {
			trait = diligent
			factor = 1.2
		}
    	modifier = {
			trait = chaste
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = kind
			factor = 1.1
		}
		modifier = {
			trait = patient
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
		modifier = {
			trait = erudite
			factor = 1.1
		}
		modifier = {
			trait = pilgrim
			factor = 1.1
		}
		modifier = {
			trait = zealous
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
		   	religion = nestorian
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			NOT = { trait = excommunicated }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = monk
				trait = nun
				learning = 16
				is_priest = yes
			}
		}
	}
}

monastic_order_monophysite = {
	primary_attribute = learning
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
    
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes
	
	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_monophysite
					rank = 1
				}
			}
		}
		age = 16
		OR = {
			religion = miaphysite
			AND = {
				is_heretic = no
				religion = monophysite
			}
		}
		NOT = { trait = excommunicated }
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_monophysite }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion = miaphysite
			AND = {
				is_heretic = no
				religion = monophysite
			}
			society_member_of = monastic_order_monophysite
		}
	}

	potential = {
		OR = {
			religion = miaphysite
			AND = {
				is_heretic = no
				religion = monophysite
			}
		}
	}

	society_rank = {
		level = 1
		limit = 50 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = monastic_order_education_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 20
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			learning = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 10 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			learning = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			temple_vassal_tax_modifier = 0.1
			build_cost_temple_modifier = -0.5
			learning = 3
			fertility = -0.15
		}
		decisions = {
			monastic_order_convert_county
		}
	}

	plots = {
	
	}

	monthly_currency_gain = {
		name = currency_name_monastic_order_monophysite
    	
		per_attribute = {
    		name = learning
    		value = 0.5
    	}
		has_trait = {
			trait = paragon
			value = 5
		}
    	has_trait = {
			trait = monk
			value = 5
		}
		has_trait = {
			trait = nun
			value = 5
		}
		has_trait = {
			trait = desert_father
			value = 5
		}
		has_trait = {
			trait = desert_mother
			value = 5
		}
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = theologian
			value = 3
		}	
		has_trait = {
			trait = celibate
			value = 2
		}
		has_trait = {
			trait = diligent
			value = 1
		}
    	has_trait = {
			trait = chaste
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = kind
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = erudite
			value = 1
		}
		has_trait = {
			trait = pilgrim
			value = 1
		}
		has_trait = {
			trait = zealous
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
		   	religion = miaphysite
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			NOT = { trait = excommunicated }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = monk
				trait = nun
				learning = 16
				is_priest = yes
			}
		}
	}
}

monastic_order_hindu = {
	primary_attribute = learning
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_indian_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_hindu
					rank = 1
				}
			}
		}
		age = 16
		religion = hindu
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_hindu }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion = hindu
			society_member_of = monastic_order_hindu
		}
	}

	potential = { religion = hindu }

	society_rank = {
		level = 1
		limit = 50 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = monastic_order_education_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 20
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			learning = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 10 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			learning = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5 
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			learning = 3
			build_cost_temple_modifier = -0.5
			health = 1
			fertility = 0.15
		}
		decisions = {
			monastic_order_convert_county
		}
	}

	monthly_currency_gain = {
		name = currency_name_monastic_order_hindu
    	
		per_attribute = {
    		name = learning
    		value = 0.5
    	}
    	has_trait = {
			trait = brahmin
			value = 5
		}
		has_trait = {
			trait = content
			value = 3
		}
		has_trait = {
			trait = erudite
			value = 3
		}
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = theologian
			value = 3
		}
		has_trait = {
			trait = diligent
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = kind
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			is_priest = yes
			factor = 10
		}
		modifier = {
			trait = brahmin
			factor = 5
		}
		modifier = {
			trait = content
			factor = 1.3
		}
		modifier = {
			trait = erudite
			factor = 1.3
		}
		modifier = {
			trait = scholar
			factor = 1.3
		}
		modifier = {
			trait = theologian
			factor = 1.3
		}
		modifier = {
			trait = diligent
			factor = 1.1
		}
		modifier = {
			trait = patient
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = kind
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
		   	religion = hindu
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = brahmin
				learning = 16
				is_priest = yes
			}
		}
	}
}

monastic_order_buddhist = {
	primary_attribute = diplomacy
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_indian_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_buddhist
					rank = 1
				}
			}
		}
		age = 16
		religion = buddhist
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_buddhist }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion = buddhist
			society_member_of = monastic_order_buddhist
		}
	}

	potential = { religion = buddhist }

	society_rank = {
		level = 1
		limit = 50 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = dharmic_good_trait_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 20
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			diplomacy = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 10 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			diplomacy = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			diplomacy = 3
			build_cost_temple_modifier = -0.5
			global_revolt_risk = -0.08
			fertility = -0.15
		}
		decisions = {
			monastic_order_convert_county
		}
	}

	monthly_currency_gain = {
		name = currency_name_monastic_order_buddhist
    	
		per_attribute = {
    		name = diplomacy
    		value = 0.5
    	}
    	has_trait = {
			trait = brahmin
			value = 5
		}
		has_trait = {
			trait = content
			value = 3
		}
		has_trait = {
			trait = kind
			value = 3
		}
		has_trait = {
			trait = patient
			value = 3
		}
		has_trait = {
			trait = diligent
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = chaste
			value = 1
		}
		has_trait = {
			trait = celibate
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = theologian
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			is_priest = yes
			factor = 10
		}
		modifier = {
			trait = brahmin
			factor = 5
		}
		modifier = {
			trait = content
			factor = 1.3
		}
		modifier = {
			trait = kind
			factor = 1.3
		}
		modifier = {
			trait = patient
			factor = 1.3
		}
		modifier = {
			trait = diligent
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = chaste
			factor = 1.1
		}
		modifier = {
			trait = celibate
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
		modifier = {
			trait = theologian
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
		   	religion = buddhist
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = brahmin
				learning = 16
				is_priest = yes
			}
		}
	}
}

monastic_order_jain = {
	primary_attribute = learning
	is_religious = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = monastic_orders_indian_interface
	society_ranks_gfx = monk_ranks
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes
	
	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = monastic_order_jain
					rank = 1
				}
			}
		}
		age = 16
		religion = jain
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_monastic_order_jain }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion = jain
			society_member_of = monastic_order_jain
		}
	}

	potential = { religion = jain }

	society_rank = {
		level = 1
		limit = 50 
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
			fertility = -0.15
		}
		custom_tooltip = dharmic_good_trait_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 20
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			learning = 1
			fertility = -0.15
		}
		decisions = {
			monastic_orders_go_celibate #Power: toggle celibacy
			monastic_orders_stop_celibate
			monastic_orders_spiritual_guidance
		}
	}
	
	society_rank = {
		level = 3
		limit = 10 
		startup_limit = 3
		modifier = {
			monthly_character_piety = 0.2
			learning = 2
			build_cost_temple_modifier = -0.25
			fertility = -0.15
		}
		decisions = {
			monastic_orders_invite_ascetic
			monastic_orders_teach_virtue
		}
	}

	society_rank = {
		level = 4
		limit = 5
		startup_limit = 1
		modifier = { 
			monthly_character_piety = 0.5
			learning = 3
			build_cost_temple_modifier = -0.5
			same_religion_opinion = 30
			hindu_opinion = 15
			buddhist_opinion = 15
			fertility = -0.15
		}
		decisions = {
			monastic_order_convert_county
		}
	}

	plots = {
	
	}
	
	monthly_currency_gain = {
		name = currency_name_monastic_order_jain
    	
		per_attribute = {
    		name = learning
    		value = 0.5
    	}
    	has_trait = {
			trait = brahmin
			value = 5
		}
		has_trait = {
			trait = content
			value = 3
		}
		has_trait = {
			trait = kind
			value = 3
		}
		has_trait = {
			trait = patient
			value = 3
		}
		has_trait = {
			trait = diligent
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = chaste
			value = 1
		}
		has_trait = {
			trait = celibate
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = theologian
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			is_priest = yes
			factor = 10
		}
		modifier = {
			trait = brahmin
			factor = 5
		}
		modifier = {
			trait = brahmin
			factor = 1.5
		}
		modifier = {
			trait = content
			factor = 1.3
		}
		modifier = {
			trait = kind
			factor = 1.3
		}
		modifier = {
			trait = patient
			factor = 1.3
		}
		modifier = {
			trait = diligent
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = chaste
			factor = 1.1
		}
		modifier = {
			trait = celibate
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
		modifier = {
			trait = theologian
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
		   	religion = jain
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = zealous
				trait = scholar
				trait = theologian
				trait = brahmin
				learning = 16
				is_priest = yes
			}
		}
	}
}

hermetics = {
	primary_attribute = learning
	society_ranks_gfx = generic_ranks
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	sound = hermetic_society_interface
	non_interference = {
		always = yes
	}
	
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes
	
	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = hermetics
					rank = 1
				}
			}
			OR = {
				is_landed = yes
				is_patrician = yes
			}
		}
		learning = 10
		OR = {
			religion_group = christian
			religion_group = muslim
			religion_group = jewish_group
			religion_group = zoroastrian_group
			custom_tooltip = {
				text = zunist_hermetic_join_tooltip
				hidden_trigger = {
					OR = {
						religion = zun_pagan					
						religion = zun_pagan_reformed
					}
				}
			}
			is_reformed_pagan_religion = yes
			religion = taoist
		}
		NOR = {
			is_nomadic = yes
			is_tribal = yes
		}
		hidden_trigger = { mercenary = no }
		age = 16
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion_group = christian
			religion_group = muslim
			religion_group = jewish_group
			religion_group = zoroastrian_group
			religion = zun_pagan
			religion = zun_pagan_reformed
			is_reformed_pagan_religion = yes
			religion = taoist
			society_member_of = hermetics
		}
	}
	
	potential = {
		#If something is added here, it could break apprenticeship. Create an event if they can get kicked out. title_hermetics_apprentice
	}
	
	society_rank = {
		level = 1
		limit = 200
		startup_limit = 10
		modifier = {
			church_opinion = -10
			#economy_techpoints = 0.05
		}
		decisions = {
			hermetics_write_theory_paper # Enables you to write a theorem paper that, if approved, gives you society power
		}
	}
	
	society_rank = {
		level = 2
		limit = 100
		startup_limit = 6
		modifier = { 
			learning = 1
			church_opinion = -10
		}
		decisions = {
			hermetics_perform_scrying # Enables you to perform a scrying and gain an omen
			brew_happiness_potion # Enables you to brew a potion
		}
	}
	
	society_rank = {
		level = 3
		limit = 50
		startup_limit = 4
		modifier = {
			learning = 2
			church_opinion = -10
		}
		decisions = {
			hermetics_make_horoscope # Enables you to "predict" your children's future
		}
	}

	society_rank = {
		level = 4
		limit = 20
		startup_limit = 2
		modifier = { 
			learning = 3
			church_opinion = -10
		}
		decisions = {
			choose_hermetic_art # Enables you to pick/change your lifestyle trait
			hermetics_write_magnum_opus # Write an enciphered book of lore (artifact)
		}
	}
	
	plots = {
	}
	
	monthly_currency_gain = {
		name = currency_name_hermetics
		
		per_attribute = {
    		name = learning
    		value = 0.5
    	}
		has_trait = {
			value = 2
			trait = diligent
		}
		has_trait = {
			value = 1
			trait = scholar
		}
		has_trait = {
			value = 1
			trait = mystic
		}
		has_trait = {
			value = 1
			trait = erudite
		}
		has_trait = {
			value = 1
			trait = stubborn
		}
		has_trait = {
			value = 1
			trait = patient
		}
		has_trait = {
			value = 1
			trait = genius
		}
		has_trait = {
			value = 1
			trait = quick
		}
		has_trait = {
			value = 1
			trait = shrewd
		}
		has_trait = {
			value = 1
			trait = just
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			factor = 2
			trait = diligent
		}
		modifier = {
			factor = 1.5
			trait = scholar
		}
		modifier = {
			factor = 1.5
			trait = mystic
		}
		modifier = {
			factor = 1.5
			trait = erudite
		}
		modifier = {
			factor = 1.5
			trait = stubborn
		}
		modifier = {
			factor = 1.5
			trait = patient
		}
		modifier = {
			factor = 1.5
			OR = {
				trait = genius
				trait = quick
				trait = shrewd
			}
		}
		modifier = {
			factor = 1.5
			trait = just
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
			age = 16
			is_in_society = no
			is_dumb_trigger = no
			OR = {
				NOT = { is_priest = yes }
				OR = {
					trait = mystic
					trait = scholar
					trait = cynical
				}
			}
			OR = {
				AND = {
					is_landed = yes
					OR = { 
						learning = 14
						trait = scholar
						trait = faqih
						trait = erudite
						trait = genius
						trait = mystic
					}
				}
				AND = {
					learning = 18
					OR = {
						trait = scholar
						trait = faqih
						trait = erudite
						trait = genius
						trait = mystic
						learning = 20
					}
				}
			}
			OR = {
				religion_group = christian
				religion_group = muslim
				religion_group = jewish_group
				religion_group = zoroastrian_group
				religion = zun_pagan
				religion = zun_pagan_reformed
				is_reformed_pagan_religion = yes
				religion = taoist
			}
		}
	}
}

###THE ASSASSINS###
the_assassins = {
	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
	
	active = {
		has_dlc = "Mystics"
	}
	indestructible = yes

	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_assassins
					rank = 1
				}
			}
		}
		has_assassins_prerequisites_inferface = yes
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		OR = {
			religion_group = muslim
			secret_religion = shiite
			AND = {
				ai = no
				NOT = { trait = zealous }
				any_playable_ruler = {
					religion = shiite
					NOT = {
						distance_from_realm = { value = 300 who = ROOT }
					}
				}
			}
			society_member_of = the_assassins
		}
		age = 16
		OR = {
			is_female = no
			has_game_rule = {
				name = gender
				value = all
			}
			has_game_rule = {
				name = gender
				value = plus
			}
		}
	}

	potential = {
		OR = {
			religion = shiite
			secret_religion = shiite
		}
	}

	society_rank = {
		level = 1
		limit = 20 
		startup_limit = 10
		modifier = {
			is_visible = {
				OR = {
					society_member_of = the_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 = the_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 = 1 # 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 = the_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 = 1 # 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 = the_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 = 1 # 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_the_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 = shiite
			age = 16
			OR = {
				is_female = no
				has_game_rule = {
					name = gender
					value = all
				}
				has_game_rule = {
					name = gender
					value = plus
				}
			}
			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 }
			OR = {
				NOT = { holy_order = yes }
				primary_title = { title = d_hashshashin }
			}
		}
	}
}

###DEVIL WORSHIPERS###
the_satanists = {
	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 = {
		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_satanists
					rank = 1
				}
			}
		}
		has_satanists_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 = {
			true_religion_group = christian
			true_religion_group = jewish_group
			true_religion = zun_pagan
			true_religion = zun_pagan_reformed
			society_member_of = the_satanists
		}
	}

	potential = { } #no rules

	society_rank = {
		level = 1
		limit = 70 
		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 = 35
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_satanists
					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 = 18 
		startup_limit = 3
		modifier = {
			is_visible = {
				OR = {
					society_member_of = the_satanists
					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_satanists
					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
		}
		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 = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
			controls_religion = no
			OR = {
				true_religion_group_christian_trigger = yes
				true_religion_group_jewish_group_trigger = yes
				true_religion_zun_pagan_trigger = yes
				true_religion = zun_pagan_reformed
			}
			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_trollcrafters = {
	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 = {
		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_trollcrafters
					rank = 1
				}
			}
		}
		has_trollcrafters_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 = norse_pagan
			religion = norse_pagan_reformed
			secret_religion = norse_pagan
			secret_religion = norse_pagan_reformed
			religion = german_pagan
			religion = german_pagan_reformed
			secret_religion = german_pagan
			secret_religion = german_pagan_reformed
			society_member_of = the_trollcrafters
		}
	}
	
	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_trollcrafters
					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_trollcrafters
					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_trollcrafters
					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_trollcrafters
    
		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 = one_eyed
			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 = one_eyed
			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 = {
				true_religion_norse_pagan_reformed_trigger = yes
				true_religion_norse_pagan_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_kali = {
	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 = {
		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_cult_of_kali
					rank = 1
				}
			}
		}
		has_cult_of_kali_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 = hindu
			secret_religion = hindu
			society_member_of = the_cult_of_kali
		}
	}

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

	potential = { } #no rules
	
	society_rank = { 
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			is_visible = {
				OR = {
					society_member_of = the_cult_of_kali
					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_kali
					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_kali
					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_cult_of_kali
    
		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 = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
	    	controls_religion = no
    		true_religion_hindu_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_cold_ones = {
	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 = {
		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_cold_ones
					rank = 1
				}
			}
		}
		has_cold_ones_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 = baltic_pagan
			religion = baltic_pagan_reformed
			secret_religion = baltic_pagan
			secret_religion = baltic_pagan_reformed
			religion = slavic_pagan
			religion = slavic_pagan_reformed
			secret_religion = slavic_pagan
			secret_religion = slavic_pagan_reformed
			religion = finnish_pagan
			religion = finnish_pagan_reformed
			secret_religion = finnish_pagan
			secret_religion = finnish_pagan_reformed
			society_member_of = the_cold_ones		
		}
	}

	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_cold_ones
					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_cold_ones
					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_cold_ones
					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
			}
		}
	}
	
	monthly_currency_gain = {
		name = currency_name_the_cold_ones
    
		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 = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
	    	controls_religion = no
    		OR = {
				religion = baltic_pagan
				religion = baltic_pagan_reformed
				secret_religion = baltic_pagan
				secret_religion = baltic_pagan_reformed
				religion = slavic_pagan
				religion = slavic_pagan_reformed
				secret_religion = slavic_pagan
				secret_religion = slavic_pagan_reformed			
			}
			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_plaguebringers = {
	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 = {
		hidden_trigger = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = the_plaguebringers
					rank = 1
				}
			}
		}
		has_plaguebringers_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 = tengri_pagan
			religion = tengri_pagan_reformed
			secret_religion = tengri_pagan
			secret_religion = tengri_pagan_reformed
			society_member_of = the_plaguebringers
		}
	}
	
	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_plaguebringers
					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_plaguebringers
					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_plaguebringers
					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_plaguebringers
    
		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 = {
			NOT = {
				has_game_rule = {
					name = devil_worshipers
					value = none
				}
			}
			ai = yes
	    	controls_religion = no 
	    	OR = {
		    	true_religion_tengri_pagan_trigger = yes
				true_religion_tengri_pagan_reformed_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
			}
		}
	}
}

# Hardcoded society tag. If this exists, religions will get versions of this society generated for them unless specifically opted out, or another is specificed. See dynamic_societies.info for more documentation
secret_religious_society_template = {
	template = yes
	primary_attribute = diplomacy
	is_religious = yes
	is_secret = yes
	opinion_to_other_members = +10
	opinion_per_rank_above = +5
	opinion_to_perceived_members = +10
	criminal = yes
	sound = secret_cults_interface
	society_ranks_gfx = secret_ranks
	
	active = {
		always = no
	}
	non_interference = {
		FROM = {
			same_realm = ROOT
		}
	}
	
	can_join_society = {
		hidden_trigger = {
			NAND = {
				ai = yes
				is_society_rank_full = { 
					society = FROM
					rank = 1
				}
			}
		}
		age = 16
		any_society_member = { society_member_of = FROM }
		secret_religion = FROM
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}

	show_society = {
		any_society_member = { society_member_of = FROM }
		secret_religion = FROM
	}
	
	potential = {
		age = 16
		secret_religion = FROM
	}
	
	society_rank = {
		level = 1
		limit = 50
		startup_limit = 0
		decisions = {
			secret_religions_induct_child
			secret_religions_evoke_sympathy
		}
	}
	
	society_rank = {
		level = 2
		limit = 30
		startup_limit = 0
		modifier = { 
			is_visible = {
				OR = {
					same_society_as = FROM
					FROM = { is_society_discovered = yes }
				}
			}
			diplomacy = 1
		}
		decisions = {
			secret_religions_induct_character
		}
	}
	
	society_rank = {
		level = 3
		limit = 10
		startup_limit = 0
		modifier = {
			is_visible = {
				OR = {
					same_society_as = FROM
					FROM = { is_society_discovered = yes }
				}
			}
			diplomacy = 2
		}
		decisions = {
			secret_religions_prepare_grounds
		}
	}

	society_rank = {
		level = 4
		limit = 1
		startup_limit = 0
		modifier = { 
			diplomacy = 3
			is_visible = {
				OR = {
					same_society_as = FROM
					FROM = { is_society_discovered = yes }
				}
			}
		}
		decisions = {
			secret_religions_openly_adopt_faith
		}
	}
	
	plots = {
	
	}
	
	monthly_currency_gain = {
		name = secret_religion_currency
		
		per_attribute = {
    		name = diplomacy
    		value = 0.5
    	}
		has_trait = {
			trait = zealous
			value = 3
		}
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = theologian
			value = 3
		}	
		has_trait = {
			trait = celibate
			value = 2
		}
		has_trait = {
			trait = diligent
			value = 1
		}
    	has_trait = {
			trait = chaste
			value = 1
		}
		has_trait = {
			trait = temperate
			value = 1
		}
		has_trait = {
			trait = charitable
			value = 1
		}
		has_trait = {
			trait = kind
			value = 1
		}
		has_trait = {
			trait = patient
			value = 1
		}
		has_trait = {
			trait = humble
			value = 1
		}
		has_trait = {
			trait = honest
			value = 1
		}
		has_trait = {
			trait = erudite
			value = 1
		}
		has_trait = {
			trait = pilgrim
			value = 1
		}
		society_rank = {
			rank = 4
			value = 10
		}
	}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {
		value = 10

		modifier = {
			trait = zealous
			factor = 1.3
		}
		modifier = {
			trait = scholar
			factor = 1.3
		}
		modifier = {
			trait = theologian
			factor = 1.3
		}
		modifier = {
			trait = celibate
			factor = 1.2
		}
		modifier = {
			trait = diligent
			factor = 1.2
		}
    	modifier = {
			trait = chaste
			factor = 1.1
		}
		modifier = {
			trait = temperate
			factor = 1.1
		}
		modifier = {
			trait = charitable
			factor = 1.1
		}
		modifier = {
			trait = kind
			factor = 1.1
		}
		modifier = {
			trait = patient
			factor = 1.1
		}
		modifier = {
			trait = humble
			factor = 1.1
		}
		modifier = {
			trait = honest
			factor = 1.1
		}
		modifier = {
			trait = erudite
			factor = 1.1
		}
		modifier = {
			trait = pilgrim
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
	    	always = no
		}
	}
}