# The Hanseatic League
country_event = {

	id = 1091
	
	trigger = {
		has_country_flag = hanseatic_league
		NOT = { has_country_flag = hanseatic_member }
	}
	
	mean_time_to_happen = {
		months = 6
		
		modifier = {
			factor = 0.9
			mercantilism_freetrade = 3
		}
		modifier = {
			factor = 0.9
			mercantilism_freetrade = 4
		}
		modifier = {
			factor = 0.9
			aristocracy_plutocracy = 3
		}
		modifier = {
			factor = 0.9
			aristocracy_plutocracy = 4
		}
		modifier = {
			factor = 0.9
			num_of_ports = 1
		}
		modifier = {
			factor = 0.9
			num_of_ports = 2
		}
		modifier = {
			factor = 1.2
			NOT = { num_of_ports = 1 }
		}
	}
	
	title = "EVTNAME1091"
	desc = "EVTDESC1091"
	
	option = {
		name = "EVTOPTA1091"			# Join the alliance
		ai_chance = { factor = 80 }
		set_country_flag = hanseatic_member
		mercantilism_freetrade = 1
		add_country_modifier = {
			name = "hanseatic_league"
			duration = 10950
		}
		any_country = {
			limit = { has_country_flag = hanseatic_member }
			relation = { who = THIS value = 40 }
		}
	}
	option = {
		name = "EVTOPTB1091"			# Decline the offer
		ai_chance = { factor = 20 }
		clr_country_flag = hanseatic_league
		any_country = {
			limit = { has_country_flag = hanseatic_member }
			relation = { who = THIS value = -40 }
		}
		aristocracy_plutocracy = -2
	}
}


# Decline of the Hanseatic League
country_event = {

	id = 1092
	
	trigger = {
		NOT = { has_country_modifier = hanseatic_league }
		has_country_flag = hanseatic_member
		NOT = { mercantilism_freetrade = -2 }
	}
	
	mean_time_to_happen = {
		months = 300

		modifier = {
			factor = 0.9
			idea = national_trade_policy
		}
		modifier = {
			factor = 1.1
			NOT = { idea = national_trade_policy }
		}
		modifier = {
			factor = 0.9
			NOT = { num_of_trade_agreements = 1 }
		}
		modifier = {
			factor = 0.9
			NOT = { trade_efficiency = 0.4 }
		}
		modifier = {
			factor = 0.9
			NOT = { trade_efficiency = 0.5 }
		}
		modifier = {
			factor = 1.1
			trade_efficiency = 0.7
		}
		modifier = {
			factor = 1.1
			trade_efficiency = 0.8
		}		
	}
	
	title = "EVTNAME1092"
	desc = "EVTDESC1092"
	
	option = {
		name = "EVTOPTA1092"			# Continue to support it
		ai_chance = { factor = 60 }
		stability = -2
		any_country = {
			limit = { has_country_flag = hanseatic_member }
			relation = { who = THIS value = 50 }
		}
	}
	option = {
		name = "EVTOPTB1092"			# Leave the alliance
		ai_chance = { factor = 40 }
		clr_country_flag = hanseatic_league
		clr_country_flag = hanseatic_member
		any_country = {
			limit = { has_country_flag = hanseatic_member }
			relation = { who = THIS value = -50 }
		}
		add_country_modifier = {
			name = "hanseatic_league_declines"
			duration = 365			
		}
	}
}


# Hanseatic Kontor
province_event = {

	id = 1093
	
	trigger = {
		owner = {
			any_neighbor_country = {
				has_country_flag = hanseatic_member		
			}
			NOT = { year = 1600 }
			advisor = trader
			mercantilism_freetrade = 2
			NOT = { has_country_flag = hanseatic_kontor }
		}
	}
	
	mean_time_to_happen = {
		months = 300

		modifier = {
			factor = 0.9
			owner = { idea = shrewd_commerce_practise }
		}
		modifier = {
			factor = 1.1
			owner = { NOT = { idea = shrewd_commerce_practise } }
		}
		modifier = {
			factor = 0.9
			owner = { num_of_trade_agreements = 1 }
		}
		modifier = {
			factor = 0.9
			owner = { num_of_trade_agreements = 2 }
		}
		modifier = {
			factor = 1.1
			owner = { NOT = { num_of_trade_agreements = 1 } }
		}
		modifier = {
			factor = 0.9
			owner = { trade_efficiency = 0.6 }
		}
		modifier = {
			factor = 0.9
			owner = { trade_efficiency = 0.7 }
		}
	}
	
	title = "EVTNAME1093"
	desc = "EVTDESC1093"
	
	option = {
		name = "EVTOPTA1093"			# Build a Kontor
		ai_chance = { factor = 80 }
		owner = {
			set_country_flag = hanseatic_kontor
			set_country_flag = hanseatic_member
			prestige = 0.02
			merchants = 2
			stability = -1		
		}
		add_province_modifier = {
			name = "hanseatic_kontor"
			duration = 10950
		}
	}
	option = {
		name = "EVTOPTB1093"			# There are better investments
		ai_chance = { factor = 20 }
		owner = {
			prestige = -0.02
			aristocracy_plutocracy = -1
			set_country_flag = hanseatic_kontor
		}
	}
}


# Rifts in the alliance
country_event = {

	id = 1094
	
	trigger = {
		has_country_flag = hanseatic_member
		idea = shrewd_commerce_practise
		any_neighbor_country = {
			has_country_flag = hanseatic_member
			NOT = { relation = { who = THIS value = 60 } }
		}
		NOT = { year = 1600 }	
		NOT = { has_country_flag = rivalry }
	}
	
	mean_time_to_happen = {
		months = 240
		
		modifier = {
			factor = 0.8
			any_neighbor_country = {
				has_country_flag = hanseatic_member
				relation = { who = THIS value = 40 }
			}
		}				
		modifier = {
			factor = 0.9
			num_of_monopolys = 1
		}
		modifier = {
			factor = 1.1
			NOT = { num_of_monopolys = 1 }
		}
		modifier = {
			factor = 1.1
			NOT = { trade_efficiency = 0.4 }
		}
		modifier = {
			factor = 1.1
			NOT = { trade_efficiency = 0.5 }
		}
		modifier = {
			factor = 0.9
			NOT = { trade_efficiency = 0.6 }
		}
		modifier = {
			factor = 0.9
			NOT = { trade_efficiency = 0.7 }
		}
		modifier = {
			factor = 0.9
			NOT = { trade_efficiency = 0.8 }
		}
		modifier = {
			factor = 0.9
			num_of_ports = 1
		}
		modifier = {
			factor = 1.1
			NOT = { num_of_ports = 1 }
		}
		modifier = {
			factor = 0.9
			idea = merchant_adventures
		}
		modifier = {
			factor = 1.1
			NOT = { idea = merchant_adventures }
		}
	}
	
	title = "EVTNAME1094"
	desc = "EVTDESC1094"
	
	option = {
		name = "EVTOPTA1094"				# Assemble a meeting
		ai_chance = { factor = 70 }
		set_country_flag = rivalry	
		stability = 1
		any_country = {
			limit = { has_country_flag = hanseatic_member }
			relation = { who = THIS value = 50 }
		}
	}
	option = {
		name = "EVTOPTB1094"				# We can't be bothered
		ai_chance = { factor = 30 }
		set_country_flag = rivalry
		treasury = 50
		stability = -1
		any_country = {
			limit = { has_country_flag = hanseatic_member }
			relation = { who = THIS value = -50 }
		}
	}
}