estate_burghers =
{
	icon = 3
	
	color = { 35 35 150 }
	
	# Is estate kept in control of province on conquest?
	keep_on_conquest = no	
	
	min_provinces_to_want_territory = 5
	wanted_territory_modifier = {
		desc = EST_VAL_REPUBLIC
		trigger = {
			government = republic
			NOT = { has_disaster = estate_nobility_disaster }
		}
		value = 20
	}	

	# If true, country will get estate
	trigger = {	
		NOT = { government = merchant_republic }
		NOT = { government = veche_republic }
		NOT = { government = trading_city }
		NOT = { government = revolutionary_republic }
		NOT = { government = native_council }
		NOT = { government = siberian_native_council }
		NOT = { government = parliamentary_republic }
		NOT = { government = presidental_republic }
		NOT = { government = parliamentary_monarchy }
		NOT = { government = communist_dictatorship }
		NOT = { government = socialist_republic }
		NOT = { government = fascist_dictatorship }
		NOT = { government = military_junta }
		NOT = { government = imperial_roman_republic }
		NOT = { government = plutocratic_republic }
		OR = {
			NOT = { government = celestial_empire }
			has_dlc = "Mandate of Heaven"
		}
		is_nomad = no
		is_colonial_nation = no
	}
	
	# If true, province can be granted to estate
	province_trigger = {
		OR = {
			owner = { government = republic }
			development = 10
			province_trade_power = 5
		}
	}
	
	# Min autonomy in estate provinces
	min_autonomy = 25
	
	# Estate cancels out the following multiplicative local autonomy effects:
	autonomy_does_not_affect = local_production_efficiency
	autonomy_does_not_affect = province_trade_power_modifier
	autonomy_does_not_affect = naval_forcelimit
	autonomy_does_not_affect = local_sailors_modifier

	# These scale with loyalty & power
	country_modifier_happy = {
		trade_efficiency = 0.2
		development_cost = -0.1
	}
	country_modifier_neutral = {
		trade_efficiency = 0.2
	}	
	country_modifier_angry = {
		trade_efficiency = -0.1
		development_cost = 0.1
	}
	
	# These do not scale, but only applied in provinces owned by the estate
	province_modifier_happy = {
		trade_goods_size_modifier = 0.1
		province_trade_power_modifier = 0.5
	}
	province_modifier_neutral = {
		province_trade_power_modifier = 0.5
	}		
	province_modifier_angry = {
		local_unrest = 5
	}	
	
	# Influence modifiers
	base_influence = 10
	influence_modifier = {	
		desc = EST_HIGH_DEVELOPMENT_PROVINCE
		trigger = {
			any_owned_province = {
				development = 30
			}
		}
		influence = 5
	}	
	influence_modifier = {	
		desc = EST_VAL_IMPERIAL_CITY
		trigger = {
			government = imperial_city
		}
		influence = 30
	}
	influence_modifier = {	
		desc = EST_VAL_COT
		trigger = {
			NOT = { government = imperial_city }
			any_owned_province = {
				OR = {
					has_province_modifier = inland_center_of_trade_modifier
					has_province_modifier = center_of_trade_modifier
				}
			}
		}
		influence = 5
	}
	influence_modifier = {
		desc = EST_VAL_HANSEATIC_CITY
		trigger = {
			NOT = { government = imperial_city }
			OR = {
				capital = 1 #Stockholm
				capital = 6 #Skåne
				capital = 23 #Bergen
				capital = 36 #Reval
				capital = 38 #Riga
				capital = 41 #Königsberg
				capital = 43 #Danzig
				capital = 44 #Hamburg
				capital = 45 #Lubeck
				capital = 46 #Wismar
				capital = 47 #Stralsund
				capital = 52 #Magdeburg
				capital = 53 #Luneburg
				capital = 54 #Stade
				capital = 56 #Osnabruck
				capital = 57 #Brunswick
				capital = 85 #Köln
				capital = 86 #Munster
				capital = 90 #Bruges
				capital = 100 #Groningen
				capital = 236 #London
				capital = 238 #Ipswich
				capital = 274 #Pskov
				capital = 275 #Polotsk
				capital = 310 #Novgorod
				capital = 1744 # Antwerp
				capital = 1834 # Dorpat
				capital = 1858 # Stettin
				capital = 1859 # Torun
				capital = 1860 # Bishop's Lynn
				capital = 1874 # Bremen
				capital = 1936 # Kaunas
				capital = 2994 # Greifswald
				capital = 2995 # Stolp
			}
		}	
		influence = 5
	}
	influence_modifier = {
		desc = EST_VAL_EAST_AFRICAN_TRADE_CITIES
		trigger = {
			capital_scope = {
				OR = {
					area = central_swahili_coast_area
					area = mombasa_area
					area = mozambique_area
					area = northern_swahili_coast_area
					area = mogadishu_area
				}
			}
		}
		influence = 5
	}
	influence_modifier = {
		desc = EST_VAL_NAHUATL
		trigger = {
			religion = nahuatl
		}	
		influence = -5
	}
	influence_modifier = {
		desc = EST_VAL_LOW_TRADE_INCOME
		trigger = {
			NOT = { trade_income_percentage = 0.25 }
		}	
		influence = -5
	}
	influence_modifier = {
		desc = EST_VAL_HIGH_TRADE_INCOME
		trigger = {
			trade_income_percentage = 0.5
			NOT = { trade_income_percentage = 0.75 }
		}	
		influence = 5
	}
	influence_modifier = {
		desc = EST_VAL_VERY_HIGH_TRADE_INCOME
		trigger = {
			trade_income_percentage = 0.75
		}	
		influence = 10
	}
	influence_modifier = {
		desc = EST_VAL_CELESTIAL_EMPIRE
		trigger = {
			government = celestial_empire
		}		
		influence = -10
	}
	influence_modifier = {
		desc = EST_VAL_OTHER_ESTATE_IN_POWER
		trigger = {
			OR = {
				has_disaster = estate_nobility_disaster
				has_disaster = estate_church_disaster
			}
		}	
		influence = -40
	}
	
	loyalty_modifier = {
		desc = EST_VAL_OTHER_ESTATE_IN_POWER_LOY
		trigger = {
			OR = {
				has_disaster = estate_nobility_disaster
				has_disaster = estate_church_disaster
			}
		}
		loyalty = -20
	}
	loyalty_modifier = {
		desc = EST_VAL_FULL_PLUTOCRATIC
		trigger = {
			full_idea_group = plutocracy_ideas
		}
		loyalty = 10
	}
	
	#Custom Names
	custom_name = {
		desc = estate_bourgeoisie
		trigger = {
			culture_group = french
		}
	}
	custom_name = {
		desc = estate_shangbang
		trigger = {
			culture_group = east_asian
		}
	}
	custom_name = {
		desc = estate_merchant_guilds
		trigger = {
			NOT = { religion_group = christian } #Diversify a bit more.
		}
	}
	
	# For province assignment
	ai_grant_province = {
		factor = 1
		modifier = {
			factor = 0.5
			NOT = { province_trade_power = 5 }
		}			
		modifier = {
			factor = 2
			province_trade_power = 10
		}
		modifier = {
			factor = 0.1
			has_estate = estate_cossacks
			has_terrain = steppe
		}		
	}	
	
	# Does the AI want to give any extra territory beyond the minimum?
	ai_territory_modifier = {
		trigger = {
			government = monarchy
			technology_group = western
			num_of_cities = 10
		}	
		value = 10
	}	
	ai_territory_modifier = {
		trigger = {
			has_idea_group = trade_ideas
			num_of_cities = 10
		}	
		value = 5			
	}
	ai_territory_modifier = {
		trigger = {
			has_idea_group = plutocracy_ideas
			num_of_cities = 10
		}	
		value = 5		
	}		

	# Special interactions
	interaction = {
		name = "ASK_FOR_CONTRIBUTION"
		icon = 6
		
		years_between_use = 10
		
		potential = {
			NOT = { has_disaster = estate_church_disaster }
			NOT = { has_disaster = estate_nobility_disaster }
		}
		
		trigger = {
			estate_loyalty = {
				estate = estate_burghers
				loyalty = 30
			}				
		}
		
		effect = {
			if = {
				limit = {
					NOT = {
						estate_influence = {
							estate = estate_burghers
							influence = 50
						}	
					}
				}
				add_years_of_income = 0.25
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 50
					}
					NOT = {
						estate_influence = {
							estate = estate_burghers
							influence = 75
						}	
					}
				}
				add_years_of_income = 0.5
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 75
					}
					NOT = {
						estate_influence = {
							estate = estate_burghers
							influence = 100
						}	
					}
				}
				add_years_of_income = 0.75
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 100
					}
				}
				add_years_of_income = 1
			}				
			add_estate_loyalty = {
				estate = estate_burghers
				loyalty = -10
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 50
					}	
				}
			}
			modifier = {
				factor = 0
				treasury = 1
			}
		}
	}
	interaction = {
		name = "DEMAND_SUPPORT_BURGHERS"
		icon = 3
		
		years_between_use = 20
		
		potential = {
			NOT = { has_disaster = estate_church_disaster }
			NOT = { has_disaster = estate_nobility_disaster }
		}
		
		trigger = {		
			estate_loyalty = {
				estate = estate_burghers
				loyalty = 30
			}	
			estate_influence = {
				estate = estate_burghers
				influence = 25
			}			
		}
		
		effect = {
			if = {
				limit = {
					NOT = {
						estate_influence = {
							estate = estate_burghers
							influence = 50
						}	
					}
				}
				add_dip_power = 50
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 50
					}
					NOT = {
						estate_influence = {
							estate = estate_burghers
							influence = 75
						}	
					}
				}
				add_dip_power = 100
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 75
					}
					NOT = {
						estate_influence = {
							estate = estate_burghers
							influence = 100
						}	
					}
				}
				add_dip_power = 150
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 100
					}
				}
				add_dip_power = 200
			}				
			add_estate_loyalty = {
				estate = estate_burghers
				loyalty = -20
			}
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	interaction = {
		name = "GRANT_MONOPOLY_CHARTER"
		icon = 17
		
		years_between_use = 20
		
		trigger = {
			always = yes
		}
		
		effect = {
			add_prestige = -5
			add_estate_influence_modifier = {
				estate = estate_burghers
				desc = EST_VAL_GRANTED_MONOPOLIES
				influence = 10
				duration = 7300
			}
			add_estate_loyalty = {
				estate = estate_burghers
				loyalty = 15
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				estate_influence = {
					estate = estate_burghers
					influence = 60
				}				
			}
			modifier = {
				factor = 0
				estate_loyalty = {
					estate = estate_burghers
					loyalty = 30
				}				
			}			
		}
	}
	interaction = {
		name = "RECRUIT_MINISTER"
		icon = 10
		
		years_between_use = 30
		
		potential = {
			NOT = { has_disaster = estate_church_disaster }
			NOT = { has_disaster = estate_nobility_disaster }
		}
		
		trigger = {
			estate_influence = {
				estate = estate_burghers
				influence = 40
			}
		}
		
		effect = {
			if = {
				limit = {
					monthly_income = 25
				}
				define_advisor = {
					type = master_of_mint
					skill = 3
					discount = yes
				}
			}
			if = {
				limit = { NOT = { monthly_income = 25 } }
				define_advisor = {
					type = master_of_mint
					skill = 2
					discount = yes
				}
			}
			add_estate_influence_modifier = {
				estate = estate_burghers
				desc = EST_VAL_BURGHER_MINISTER
				influence = 15
				duration = 10950
			}
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	interaction = {
		name = "GRANT_ADMIRALSHIP"
		icon = 5
		
		years_between_use = 10
		
		potential = {
			NOT = { has_disaster = estate_church_disaster }
			NOT = { has_disaster = estate_nobility_disaster }
			num_of_ports = 1
		}
		
		trigger = {
			estate_loyalty = {
				estate = estate_burghers
				loyalty = 30
			}	
			estate_influence = {
				estate = estate_burghers
				influence = 40
			}			
		}
		
		effect = {
			create_admiral = 40		
			add_estate_influence_modifier = {
				estate = estate_burghers
				desc = EST_VAL_GRANTED_ADMIRALSHIP
				influence = 20
				duration = 3650
			}
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	interaction = {
		name = "GRANT_NEW_WORLD_CHARTER"
		icon = 16
		
		years_between_use = 10
		
		potential = {
			NOT = { has_disaster = estate_church_disaster }
			NOT = { has_disaster = estate_nobility_disaster }
			has_idea_group = exploration_ideas
		}
		
		trigger = {
			estate_loyalty = {
				estate = estate_burghers
				loyalty = 30
			}	
			estate_influence = {
				estate = estate_burghers
				influence = 40
			}			
		}
		
		effect = {
			add_country_modifier = {
				name = "new_world_company"
				duration = 3650
			}
			add_estate_influence_modifier = {
				estate = estate_burghers
				desc = EST_VAL_NEW_WORLD_CHARTER
				influence = 15
				duration = 3650
			}
		}
		
		ai_will_do = {
			factor = 0
		}
	}
	
	interaction = {
		name = "COMISSION_MERCHANT_SHIPS_FOR_WAR"
		icon = 18
		
		years_between_use = 30
		
		potential = {
			NOT = { has_disaster = estate_church_disaster }
			NOT = { has_disaster = estate_nobility_disaster }
			num_of_ports = 1
			primitives = no
		}
		
		trigger = {
			estate_loyalty = {
				estate = estate_burghers
				loyalty = 30
			}	
			estate_influence = {
				estate = estate_burghers
				influence = 40
			}
			num_of_ports = 10
			any_owned_province = {
				has_port = yes
				has_estate = estate_burghers
			}
		}
		
		effect = {
			add_estate_loyalty = {
				estate = estate_burghers
				loyalty = -15
			}
			random_owned_province = {
				limit = {
					has_estate = estate_burghers
					has_port = yes
				}
				add_unit_construction = {
					amount = 5
					type = heavy_ship
					speed = 0.5
					cost = 0
				}
			}
		}
		
		ai_will_do = {
			factor = 0
		}
	}
}