jewish_order = { #society code name
	primary_attribute = learning
	is_religious = yes
	opinion_to_other_members = +10 #opinion from/of other member, see wiki for all the options
	opinion_per_rank_above = +5
	society_rank_up_decision = request_to_rank_up_within_jewish_order
	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 = jewish_order
					rank = 1
				}
			}
		}
		age = 16
		OR = {
			religion = jewish
			AND = {
				is_heretic = no
				OR = {
					religion = samaritan
					religion = karaite
				}
			}
		}
		custom_tooltip = {
			text = did_not_betray_society
			NOT = { has_character_flag = betrayed_jewish_order }
		}
		scaled_wealth = 0.25
		hidden_trigger = {
			NOT = { has_character_flag = society_join_block }
		}
	}
	
	show_society = { #society will appear in the list if these are met
		OR = {
			religion = jewish
			AND = {
				is_heretic = no
				OR = {
					religion = samaritan
					religion = karaite
				}
			}
			society_member_of = jewish_order
		}
	}	
	
	potential = {
		OR = {
			religion = jewish
			AND = {
				is_heretic = no
				OR = {
					religion = samaritan
					religion = karaite
				}
			}
		}
	}
	
	society_rank = { 
		level = 1
		limit = 100
		startup_limit = 10
		modifier = {
			monthly_character_piety = 0.05
		}
		custom_tooltip = monastic_order_education_power_tt
	}
	
	society_rank = {
		level = 2
		limit = 50
		startup_limit = 6
		modifier = { 
			monthly_character_piety = 0.1
			learning = 1
		}
		decisions = {
			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
		}
		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
		}
		decisions = {
			monastic_order_convert_county
		}
	}

	monthly_currency_gain = {
		name = jewish_order_currency #localization name of the society currency, also see custom_localization
		
		per_attribute = { 
    		name = learning
    		value = 0.5
    	}
		###learning education
		has_trait = {
			trait = detached_priest
			value = 1
		}
		has_trait = {
			trait = martial_cleric
			value = 2
		}		
		has_trait = {
			trait = scholarly_theologian
			value = 3
		}
		has_trait = {
			trait = mastermind_theologian
			value = 4
		}
		###diplomacy education
		has_trait = {
			trait = charismatic_negotiator
			value = 1
		}
		has_trait = {
			trait = grey_eminence
			value = 2
		}
		###stewardship education
		has_trait = {
			trait = fortune_builder
			value = 2
		}
		has_trait = {
			trait = midas_touched
			value = 3
		}	
		
		has_trait = {
			trait = scholar
			value = 3
		}
		has_trait = {
			trait = mystic
			value = 2
		}
		has_trait = {
			trait = theologian
			value = 3
		}
		has_trait = {
			trait = diligent
			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 = just
			value = 1
		}
		has_trait = {
			trait = erudite
			value = 2
		}
		has_trait = {
			trait = zealous
			value = 2
		}
		###negative values
		has_trait = {
			trait = drunkard
			value = -4
		}
		has_trait = {
			trait = hedonist
			value = -2
		}
		has_trait = {
			trait = scarred
			value = -1
		}
		has_trait = {
			trait = disfigured
			value = -1
		}
		has_trait = {
			trait = cynical
			value = -1
		}
		
		society_rank = {
			rank = 1
			value = 1
		}		
		society_rank = {
			rank = 2
			value = 3
		}
		society_rank = {
			rank = 3
			value = 5
		}		
		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 = 6
		}
		modifier = {
			trait = mastermind_theologian
			factor = 2
		}
		modifier = {
			trait = scholarly_theologian
			factor = 1.5
		}
		modifier = {
			trait = martial_cleric
			factor = 1.33
		}
		modifier = {
			trait = detached_priest
			factor = 1.25
		}		
		modifier = {
			trait = scholar
			factor = 1.3
		}
		modifier = {
			trait = theologian
			factor = 1.3
		}
		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 = zealous
			factor = 1.1
		}
	}
	
	startup_populate = {
	    trigger = {
			ai = yes
	    	controls_religion = no
		   	religion = jewish
			age = 16
			is_in_society = no
			NOT = { higher_tier_than = DUKE }
			NOR = {
				mercenary = yes
				holy_order = yes
			}
			NOT = { trait = cynical }
			NOT = { trait = drunkard }
			NOT = { trait = hedonist }
			has_secret_religion_trait_trigger = no
			OR = {
				trait = detached_priest
				trait = martial_cleric
				trait = zealous
				trait = scholar
				trait = theologian
				learning = 10
				is_priest = yes
			}
		}
	}
}