estate_church = {
	icon = 1

	# If true, country will get estate
	trigger = {
		NOT = { has_government_attribute = disables_estate_church }
		NOT = { has_disabled_estate = { estate = estate_church } }
		if = {
			limit = {
				religion_group = dharmic
			}
			OR = {
				has_enabled_estate = { estate = estate_church }
				NOT = { has_estate = estate_brahmins }
			}
		}
		OR = {
			has_country_flag = mmetr_enable_church_estate_flag	#MMETR added to enable by effect
			has_government_attribute = enables_estate_church
			has_enabled_estate = { estate = estate_church }
			has_unlocked_estate = { estate = estate_church }
			AND = {
				NOT = { has_government_attribute = is_pirate_republic_reform }
				NOT = { has_reform = siberian_tribe }
				NOT = { government = native }
				NOT = { is_revolutionary_republic_trigger = yes }
				NOT = { has_reform = revolutionary_empire_reform }
				NOT = { has_reform = roman_empire_reform }
				NOT = { has_reform = multi_party_system }
				NOT = { has_reform = single_party_system }
				NOT = { has_reform = military_government }
				NOT = { has_reform = communist_government }
				NOT = { has_reform = fascist_government }
				OR = {
					NOT = { tag = USA }
					government = theocracy
				}
				NOT = { religion = secularism }
				is_nomad = no
				is_colonial_nation = no
			}
		}
		#NOT = { has_government_attribute = is_merchant_republic }
		#NOT = { has_reform = veche_republic }
		#NOT = { has_reform = trading_city }
		#OR = {
		#	NOT = { has_reform = celestial_empire }
		#	has_dlc = "Mandate of Heaven"
		#}
	}

	# These scale with loyalty & power
	country_modifier_happy = {
		global_tax_modifier = 0.2
		papal_influence = 1
		devotion = 0.5
		church_power_modifier = 0.1
		monthly_fervor_increase = 1
		stability_cost_modifier = -0.1
	}
	country_modifier_neutral = {
		global_tax_modifier = 0.2
	}	
	country_modifier_angry = {
		global_tax_modifier = -0.1
		papal_influence = -1
		devotion = -0.5
		church_power_modifier = -0.25
		monthly_fervor_increase = -1
		stability_cost_modifier = 0.1
		global_unrest = 2
	}

	land_ownership_modifier = {
		church_loyalty_modifier = 0.2
	}

	province_independence_weight = {
		factor = 1
		modifier = {
			factor = 0.1
			NOT = { religion_group = owner }
		}
		modifier = {
			factor = 0.5
			NOT = { religion = owner }
		}
		modifier = {
			factor = 0.67
			NOT = { is_state_core = owner }
		}
		modifier = {
			factor = 1.2
			base_tax = 10
		}
	}

	# Influence modifiers
	base_influence = 10
	influence_modifier = {
		desc = EST_VAL_SHARIFS
		trigger = {
			tag = HED
			owns = 385 #Mecca
		}	
		influence = 20
	}
	influence_modifier = {
		desc = EST_VAL_NEO_SUFISM
		trigger = {
			has_global_flag = neo_sufism
			religion_group = muslim
		}	
		influence = 10
	}
	influence_modifier = {
		desc = EST_VAL_STATE_RELIGIOUS_MINORITY
		trigger = {
			NOT = { dominant_religion = ROOT }
		}	
		influence = -15
	}
	influence_modifier = {
		desc = EST_VAL_OTHER_ESTATE_IN_POWER
		trigger = {
			has_any_estate_disaster_active = yes
			has_not_own_estate_disaster_active = { estate = estate_church }
		}
		influence = -40
	}

	loyalty_modifier = {
		desc = EST_VAL_OTHER_ESTATE_IN_POWER_LOY
		trigger = {
			has_any_estate_disaster_active = yes
			has_not_own_estate_disaster_active = { estate = estate_church }
		}
		loyalty = -20
	}
	loyalty_modifier = {
		desc = EST_KNI_CONQUEST_OF_JERUSALEM
		trigger = {
			owns = 379
			religion = catholic
		}
		loyalty = 10
	}
	loyalty_modifier = {
		desc = EST_INWARD_PERFECTION_OFFENSIVE_WAR
		trigger = {
			has_estate_privilege = estate_church_inwards_perfection
			is_in_war = {
				attacker_leader = ROOT
			}
		}
		loyalty = -20
	}
	loyalty_modifier = {
		desc = EST_358_HOLY_SITE
		loyalty = 5
		trigger = {
			has_government_attribute = active_holy_sites_improve_clergy_loyalty
			358 = { religion = coptic has_owner_religion = yes }
		}
	}
	loyalty_modifier = {
		desc = EST_1227_HOLY_SITE
		loyalty = 5
		trigger = {
			has_government_attribute = active_holy_sites_improve_clergy_loyalty
			1227 = { religion = coptic has_owner_religion = yes }
		}
	}
	loyalty_modifier = {
		desc = EST_2313_HOLY_SITE
		loyalty = 5
		trigger = {
			has_government_attribute = active_holy_sites_improve_clergy_loyalty
			2313 = { religion = coptic has_owner_religion = yes }
		}
	}
	loyalty_modifier = {
		desc = EST_1234_HOLY_SITE
		loyalty = 5
		trigger = {
			has_government_attribute = active_holy_sites_improve_clergy_loyalty
			1234 = { religion = coptic has_owner_religion = yes }
		}
	}
	loyalty_modifier = {
		desc = EST_419_HOLY_SITE
		loyalty = 5
		trigger = {
			has_government_attribute = active_holy_sites_improve_clergy_loyalty
			419 = { religion = coptic has_owner_religion = yes }
		}
	}
	
	custom_name = {
		desc = estate_klirikoi
		trigger = {
			tag = BYZ
			culture_group = byzantine
		}
	}
	custom_name = {
		desc = estate_ogboni
		trigger = {
			tag = OYO
		}
	}
	custom_name = {
		desc = estate_tengbiise
		trigger = {
			primary_culture = mossi
			religion = shamanism
		}
	}
	custom_name = {
		desc = estate_monasteries
		trigger = {
			religion_group = buddhic	#MMETR changed
		}
	}
	custom_name = {
		desc = estate_babaylanes
		trigger = {
			tag = MAS
		}
	}
	custom_name = {
		desc = estate_brahmins
		trigger = {
			religion = hinduism
		}
	}
	custom_name = {
		desc = estate_pastors
		trigger = {
			OR = {
				religion = protestant
				religion = reformed
			}
		}
	}
	custom_name = {
		desc = estate_popes
		trigger = {
			AND = {
				religion = orthodox
				OR = {
					culture_group = east_slavic
					culture_group = south_slavic
					culture_group = west_slavic
				}
			}
		}
	}
	custom_name = {
		desc = estate_shamans
		trigger = {
			OR = {
				religion = tengri_pagan_reformed
				religion = suomenusko
				religion = shamanist
				religion = georgian_religion
				religion = norse_pagan_reformed
			}
		}
	}
	custom_name = {
		desc = HORDE_SHAMANS
		trigger = {
			has_country_flag = hordes_devout_tengri_completion_flag
			religion = tengri_pagan_reformed
		}
	}
	custom_name = {
		desc = estate_priests
		trigger = {
			OR = {
				religion = hellenism
				religion = zamolxism
				religion = nabataean
				religion = armenian_religion
				religion = romuva
				religion = germanic
				religion = egyptian
				religion = ashurism
				religion = south_arabian
				religion = shamanism		#MMETR added
				religion = satsana_phi		#MMETR added
				religion = sasanea_yang		#MMETR added
				religion = natic			#MMETR added
			}
		}
	}
	custom_name = {
		desc = estate_druids
		trigger = {
			OR = {
				religion = druidism
			}
		}
	}
	custom_name = {
		desc = estate_volkhvs
		trigger = {
			OR = {
				religion = slavic
			}
		}
	}
	custom_name = {
		desc = estate_gurus
		trigger = {
			religion = sikhism
		}
	}
	custom_name = {
		desc = estate_medicine_men
		trigger = {
			religion = totemism
		}
	}
	custom_name = {
		desc = estate_godar
		trigger = {
			religion = norse_pagan_reformed
		}
	}
	custom_name = {
		desc = estate_rabbis
		trigger = {
			religion = jewish
		}
	}
	custom_name = {
		desc = estate_mobeds
			trigger = {
				religion = zoroastrian
			}
	}
	custom_name = {
		desc = estate_kannushi
			trigger = {
				religion = shinto
			}
	}
	custom_name = {
		desc = estate_panacas
		trigger = {
			religion = inti
		}
	}
	custom_name = {
		desc = estate_gentry
		trigger = {
			OR = {
				has_reform = celestial_empire
				culture_group = east_asian
			}
		}
	}
	custom_name = {
		desc = estate_ulema
		trigger = {
			religion_group = muslim
		}
	}
	custom_name = {
		desc = estate_tlamacazqueh
		trigger = {
			religion = nahuatl
		}
	}
	custom_name = {
		desc = estate_yangban_scholars
		trigger = {
			tag = KOR
			religion = confucianism
		}
	}
	custom_name = {
		desc = estate_kahuna
		trigger = {
			capital_scope = {
				area = northern_polynesia_area
			}
			primary_culture = polynesian
			religion = animism
		}
	}
	custom_name = {
		desc = estate_tohunga
		trigger = {
			primary_culture = maori
			religion = animism
		}
	}		
	custom_name = {
		desc = estate_taula_otua
		trigger = {
			tag = TOG
			religion = animism
		}
	}	
	custom_name = {
		desc = estate_taula_aitu
		trigger = {
			tag = SAM
			religion = animism
		}
	}
	custom_name = {
		desc = estate_bete
		trigger = {
			OR = {
				tag = LAI
				tag = VIL
				tag = VNL
			}
			religion = animism
		}
	}

	#New names added to MMETR
	custom_name = {
		desc = estate_mudang
		trigger = {
			religion = muism
		}
	}
	custom_name = {
		desc = estate_qaalluu
		trigger = {
			religion = waaqism
		}
	}

	contributes_to_curia_treasury = yes
	color = { 200 150 0 }

	privileges = {
		estate_church_land_rights
		estate_church_papal_emissary
		estate_church_religious_state
		estate_church_independent_inquisition
		estate_church_new_world_mission
		estate_church_clerical_ministers
		estate_church_freedom_of_interpretation
		estate_church_clerical_oversight
		estate_church_inwards_perfection
		estate_church_enforced_one_faith
		estate_church_for_the_faith
		estate_church_karma_temples
		estate_church_influence_temples
		estate_church_brahmins_at_court
		estate_church_lao_animism
		estate_church_administrative_privileges
		estate_church_monopoly_of_incense
		estate_church_monopoly_of_wool
		estate_church_monopoly_of_wine
		estate_church_monopoly_of_slaves
		estate_church_statutory_rights
		estate_church_yakobs_churches
		estate_church_one_faith_one_culture
		estate_church_religious_diplomats
		estate_church_heir_shrine
		estate_church_embrace_singluar_cult
		estate_church_flexible_cults
		estate_church_scholar_connections
		estate_church_integrated_school
		estate_church_anti_heresy_act
		estate_church_lands_of_riga
		estate_church_bishopric_of_dorpat
		estate_church_bishopric_of_osel_wiek
		estate_church_bishopric_of_courland
		estate_church_bishopric_of_reval
		estate_church_japanese_christian_communities_privilege
		estate_church_development_of_temples
		estate_church_expand_the_theology
		estate_church_clerical_education
		estate_church_religious_delegation
		estate_church_institutionalized_clergy
		estate_church_donation_right
		estate_church_union_of_the_churches
		estate_church_BYZ_legitimization_of_dynasty
		#1.36
		estate_church_fund_dar_al_hadith
		estate_church_fund_madrasas
		estate_church_sponsor_waqf_payments
		estate_church_muslim_integration
		#1.37
		estate_church_INC_idol_making
		estate_church_MAY_cocoa_monopoly
		estate_church_religious_tolerance
		estate_church_TIM_yasa_supremacy
		estate_church_TIM_promote_ijazah
		estate_church_MUG_promote_divine_religion
		
		#New added MMETR
		estate_church_synods_of_francia
		estate_royal_abbots_francia
		estate_church_vow_of_ahimsa
		estate_church_lesser_vehicles
	}

	agendas = {
		estate_church_develop_x
		estate_church_build_temple_in_y
		estate_church_build_university_in_y
		estate_church_build_manufactory_in_y
		estate_church_convert_province_x
		estate_church_reduce_war_exhaustion
		estate_church_recover_stability
		estate_church_increase_stability
		estate_church_reduce_overextension
		estate_church_restore_devotion
		estate_church_root_out_heresy
		estate_church_relations_with_pope
		estate_church_restore_the_holy_see
		estate_church_crush_religious_revolts
		estate_church_protect_brethren
		estate_church_propagate_religion
		estate_church_relations_with_dotf
		estate_church_hire_advisor
		estate_church_fire_advisor
	}
	influence_from_dev_modifier = 1.0
}