﻿###########################
# Stark Events
###########################

add_namespace = finland

# Lannister Ultimatum
country_event = {
	id = finland.1
	title = finland.1.t
	desc = finland.1.d
	picture = GFX_report_event_soviet_tanks_snow
	
	is_triggered_only = yes
	
	option = { # Declare war
		name = finland.1.a
		ai_chance = { 
		factor = 90
		modifier = { # Don't accept if in a faction that can protect them
				factor = 0
				OR = {
					is_subject_of = HOL
#					is_in_faction_with = FRA
				}
			}
		}
		declare_war_on = {
			target = ENG
			type = annex_everything
#			generator = { 195 208 }
		}
		activate_mission = STR_save_ned_stark

	}
	option = { # Bendtheknee
		name = finland.1.b
		ai_chance = { factor = 10 }
		add_stability = -0.05
		set_global_flag = stark_apology
		ENG = {
			country_event = { days = 1 id = stark.5 }
		}
		if = {
			limit = { NOT = { has_war_with = HOL } }
			HOL = {	country_event = { days = 1 id = stark.5 }}
		}
		hidden_effect = {
			country_event = { days = 9 id = stark.11 }
		}
	}
}

# Request Swedish Assistance?
country_event = {
	id = finland.2
	title = finland.2.t
	desc = finland.2.d
	picture = GFX_report_event_soviet_finnish_pact
	
	fire_only_once = yes

#	trigger = {
#		tag = FIN
#		has_war_with = SOV
#		SWE = {
#			NOT = { has_war_with = FIN }
#			NOT = { is_in_faction_with = SOV }
#			exists = yes
#		}
#	}

#	mean_time_to_happen = {
#		days = 1
#	}

	is_triggered_only = yes

	option = {
		name = finland.2.a
		SWE = {
			country_event = { id = finland.3 }
		}
	}

	option = {
		name = finland.2.b
	}
}

# Vale Support in Winter War
country_event = {
	id = finland.3
	title = finland.3.t
	desc = finland.3.d
	picture = GFX_report_event_finnish_letter
	
	is_triggered_only = yes

	option = {
		name = finland.3.a

		ai_chance = {
			factor = 10 
			modifier = {
				factor = 10
				OR = {
					has_war = yes
					has_government = communism
				}
			}
		}

		FIN = {
			country_event = { id = finland.4 days = 3 }
			add_opinion_modifier = {
				target = ROOT
				modifier = refused_help
			}
		}
	}

	option = {
		name = finland.3.b

		ai_chance = {
			factor = 25
			modifier = {
				factor = 5							
				has_government = democratic
				FIN = {
				 has_government = democratic
				}
			}
		}

		trigger = {
			AND = {
				has_war = no
				NOT = {
					has_government = communism
				}
			}	
			has_manpower > 18402
		}
		add_manpower = -18402
		if = {
			limit = {
				has_equipment = {
					infantry_equipment > 500
				}
			}
			send_equipment = {
				target = FIN
				type = infantry_equipment
				amount = 500
			}
		}
		if = {
			limit = {
				has_equipment = {
					artillery_equipment > 250
				}
			}
			send_equipment = {
				target = FIN
				type = artillery_equipment
				amount = 250
			}
		}
		FIN = {
			country_event = { id = finland.5 days = 3 }
		}
	}

	option = {
		name = finland.3.c

		ai_chance = {

			factor = 15
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 100
				has_war = no
				has_government = democratic
				strength_ratio = {
					tag = HOL
					ratio > 0.2
				}
				FIN = {
					has_government = democratic
					strength_ratio = {
						tag = HOL 
						ratio > 0.2
					}
				}
			}			
		}

		remove_ideas = neutrality_idea
		declare_war_on = {
			target = HOL
			type = annex_everything
		}
		FIN = {
			country_event = { id = finland.6 days = 3 }
			add_to_faction = SWE
			add_opinion_modifier = {
				target = ROOT
				modifier = took_stand_for_us
			}
		}
	}
}

country_event = {
	id = finland.4
	title = finland.4.t
	desc = finland.4.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.4.a
	}
}

country_event = {
	id = finland.5
	title = finland.5.t
	desc = finland.5.d
	picture = GFX_report_event_swedish_soldier
	
	is_triggered_only = yes

	option = {
		name = finland.5.a
		add_manpower = 18402
		effect_tooltip = {
			SWE = {
				add_manpower = -18402
				if = {
					limit = {
						has_equipment = {
							infantry_equipment > 500
						}
					}
					send_equipment = {
						target = FIN
						type = infantry_equipment
						amount = 500
					}
				}
				if = {
					limit = {
						has_equipment = {
							artillery_equipment > 250
						}
					}
					send_equipment = {
						target = FIN
						type = artillery_equipment
						amount = 250
					}
				}
			}
		}
	}
}

country_event = {
	id = finland.6
	title = finland.6.t
	desc = finland.6.d
	picture = GFX_report_event_swedish_soldier
	
	is_triggered_only = yes

	option = {
		name = finland.6.a
	}
}

#Surrender when Soviet has taken too much land
country_event = {
	id = finland.7
	title = finland.7.t
	desc = finland.7.d
	picture = GFX_report_event_soviet_tanks_snow
	
	trigger = {
		tag = FIN
		has_war_with = JAP
		surrender_progress > 0.25
		has_civil_war = no
		is_in_faction = no
	}

	mean_time_to_happen = { days = 20 }

	fire_only_once = yes

	#Surrender and offer territory
	option = {
		name = finland.7.a
		ai_chance = {
			base = 8
		}
		SOV = {
			country_event = { id = finland.8 }
		}
		custom_effect_tooltip = finland.7.a_tt
		effect_tooltip = {
			SOV = { 
				white_peace = {
					tag = FIN 
					message = FIN_agree_peace 
				} 
			}
			transfer_state = 146
			transfer_state = 147
			transfer_state = 722
		}
	}

	#Never give up!
	option = {
		name = finland.7.b
		ai_chance = {
			base = 2
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

#Soviet response to Finish surrender
country_event = {
	id = finland.8
	title = finland.8.t
	desc = finland.8.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	#Accept surrender
	option = {
		name = finland.8.a
		ai_chance = {
			base = 9
		}
		white_peace = FIN
		transfer_state = 146
		transfer_state = 147
		transfer_state = 722
	}

	#Take it all
	option = {
		name = finland.8.b
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}			
		}
		FIN = { country_event = { id = finland.9 } }
	}
}

#Soviet says no!
country_event = {
	id = finland.9
	title = finland.9.t
	desc = finland.9.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.9.a
	}
}

#Robb Stark is new Lord
country_event = {
	id = finland.10
	title = finland.10.t
	desc = finland.10.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.10.a
		FIN = {
			STR_eddard = {
				set_nationality = ENG
			}
		}
		hidden_effect = {
			ENG = { country_event = { id = britain.24 days = 10 random_days = 12 } }
#			ENG = {	country_event = { days = 10 id = britain.24 }}
		}
#      		retire_country_leader = yes
	}
}

#Karstarks loothing
country_event = {
	id = finland.11
	title = finland.11.t
	desc = finland.11.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.11.a
		ai_chance = { factor = 90 }
		add_political_power = 150
		NOR = {	kill_ideology_leader = neutrality }
		NOR = {
		country_event = { id = norway.2 days = 1 } 
		}
		}
	option = {
		name = finland.11.b
		ai_chance = { factor = 5 }
		add_stability = -0.15
		}
}

#Manderly rebels
country_event = {
	id = finland.12
	title = finland.12.t
	desc = finland.12.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.12.a
		ai_chance = { factor = 90 }
		}
}

#Bolton Demands
country_event = {
	id = finland.13
	title = finland.13.t
	desc = finland.13.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.13.a
		ai_chance = { factor = 0 }
		FIN = {
			effect_tooltip = {
				transfer_state = 392
				transfer_state = 113
			}
		}
		}

	option = {
		name = finland.13.b
		ai_chance = { factor = 90 }
		FIN = {
			create_wargoal = {
				type = puppet_wargoal_focus
				target = ITA
			}
		}
		}
}

#Cede Territory to Bolton
country_event = {
	id = finland.14
	title = finland.14.t
	desc = finland.14.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.14.a
		ai_chance = { factor = 40 }
		FIN = { country_event = { id = finland.9 } }
		}
}

#Iron Bank offers loan
country_event = {
	id = finland.15
	title = finland.15.t
	desc = finland.15.d
	picture = GFX_report_event_finnish_soldiers_snow
	
	is_triggered_only = yes

	option = {
		name = finland.15.a
		ai_chance = { factor = 40 }
#		add_timed_idea = { idea = SWI_war_loan days = 356 }
		SWI = { add_timed_idea = { idea = SWI_pending_stark_loan days = 356 } }
		SWI = { country_event = { id = switzerland.4 days = 1 } }
		add_ideas = SWI_war_loan
	}
	option = {
		name = finland.15.b
		ai_chance = { factor = 0 }
	}
}

# Westerlings declare for Stark
country_event = {
	id = finland.16
	title = finland.16.t
	desc = finland.16.d
	picture = GFX_report_event_german_parade_paris
	
	fire_only_once = yes
	
	trigger = {
		tag = FIN
		FIN = { has_country_leader = { ruling_only = yes name = "Robb Stark" }}
		NOT = { country_exists = SCO }
		FIN = { has_war_with = HOL }
		58 = { is_owned_by = HOL }
		OR = {
			58 = { is_controlled_by = FIN }
			AND = {
				FIN = { is_faction_leader = yes }
				FRA = { is_in_faction_with = FIN }
				58 = { is_controlled_by = FRA }
			}
		}

#		has_war = no
#		NOT = {
#			has_civil_war = yes
#			has_idea = YUG_idea_croatian_opposition
#		}
#		OR = {
#			59 = { is_controlled_by = FIN }
#			57 = { is_controlled_by = FIN }
#			55 = { is_controlled_by = FIN }
#			28 = { is_controlled_by = FIN }
#			34 = { is_controlled_by = FIN }
#			56 = { is_controlled_by = FIN }
#			58 = { is_controlled_by = FIN }
#			3 = { is_controlled_by = FIN }
#			51 = { is_controlled_by = FIN }
#			151 = { is_controlled_by = FIN }
#			61 = { is_controlled_by = FIN }
#			63 = { is_controlled_by = FIN }
#			62 = { is_controlled_by = FIN }
#			HOL = { is_subject_of = FIN }
#		}
	}
	
	mean_time_to_happen = {
		days = 7
	}
	
	option = { # Jeyne
		name = finland.16.a
		ai_chance = {
			base = 45
		}

		FIN = { add_to_faction = SCO }

		SCO = {			
			declare_war_on = {
				target = HOL
				type = annex_everything
			}			
		}

		hidden_effect = {
			SCO = { transfer_state = 58 }
			SCO = {
				inherit_technology = HOL
				load_oob = Westerling_oob
				add_manpower = 10000
			}
#			set_autonomy = {
#				target = HOL
#				autonomy_state = autonomy_free				
#			}
#			FIN = { release_puppet = HOL }
		SCO = {
#			if = {
#				limit = { FIN = { owns_state = 63 } }
#				transfer_state = 63
#			}
#			if = {
#				limit = { FIN = { owns_state = 62 } }
#				transfer_state = 62
#			}
#			if = {
#				limit = { FIN = { owns_state = 61 } }
#				transfer_state = 61
#			}
#			if = {
#				limit = { FIN = { owns_state = 151 } }
#				transfer_state = 151
#			}
#			if = {
#				limit = { FIN = { owns_state = 51 } }
#				transfer_state = 51
#			}
#			if = {
#				limit = { FIN = { owns_state = 3 } }
#				transfer_state = 3
#			}
#			if = {
#				limit = { FIN = { owns_state = 58 } }
#				transfer_state = 58
#			}
#			if = {
#				limit = { FIN = { owns_state = 56 } }
#				transfer_state = 56
#			}
#			if = {
#				limit = { FIN = { owns_state = 34 } }
#				transfer_state = 34
#			}
#			if = {
#				limit = { FIN = { owns_state = 28 } }
#				transfer_state = 28
#			}
#			if = {
#				limit = { FIN = { owns_state = 55 } }
#				transfer_state = 55
#			}
#			if = {
#				limit = { FIN = { owns_state = 57 } }
#				transfer_state = 57
#			}
#			if = {
#				limit = { FIN = { owns_state = 59 } }
#				transfer_state = 59
#			}
#			if = {
#				limit = { FIN = { owns_state = 385 } }
#				transfer_state = 385
#			}
			set_politics = {
			
				ruling_party = democratic			
				elections_allowed = no
		
			}

			add_popularity = {
				ideology = democratic
				popularity = 0.75
			}
		}
#			HOL = { set_cosmetic_tag = HOL_FIN_puppet }
		}

	}
	option = { # Keep things
		name = finland.16.b
		ai_chance = {
			base = 5
		}
		add_timed_idea = { idea = YUG_idea_croatian_opposition days = 90 }

	}

	option = { # Play as Westerling
		name = finland.16.c
		ai_chance = {
			base = 0
		}

		SCO = { change_tag_from = FIN }

		FIN = { add_to_faction = SCO }

		SCO = {			
			declare_war_on = {
				target = HOL
				type = annex_everything
			}			
		}

		hidden_effect = {
			SCO = { transfer_state = 58 }
			SCO = {
				load_oob = Westerling_oob
				add_manpower = 10000
			}
			SCO = {
				set_politics = {
			
					ruling_party = democratic			
					elections_allowed = no
		
				}

				add_popularity = {
					ideology = democratic
					popularity = 0.75
				}
			}

		}

	}
}

# Free Ned
country_event = {
	id = finland.17
	title = finland.17.t
	desc = finland.17.d
	picture = GFX_report_event_german_parade_paris

	is_triggered_only = yes
	
#	fire_only_once = yes
	
#	trigger = {
#		tag = FIN
#		ENG = { has_completed_focus = uk_service_focus }

#		OR = {
#			FIN = {
#				has_war_with = ENG
#			}
#			ENG = {
#				exists = no
#			}
#		}

#		NOT = { has_global_flag = ned_stark_dead }
#		OR = {
#			FIN = { controls_state = 33 }
#			any_allied_country = { controls_state = 33 }
#		}
#	}
	
#	mean_time_to_happen = {
#		days = 2
#	}

	immediate = { set_global_flag = ned_stark_dead }
	
	option = { # Welcome Ned
		name = finland.17.a
		DDR = {
			STR_eddard = {
				set_nationality = FIN
			}
		}
#		FIN = {
#			create_field_marshal = {
#				name = "Ned Stark"
#				portrait_path = "gfx/leaders/CAN/Portrait_Stark_Nedfm.dds"
#				traits = { offensive_doctrine defensive_doctrine }
#				id = 29
#				skill = 5
#				attack_skill = 2
#				defense_skill = 3
#				planning_skill = 4
#				logistics_skill = 4
#			}
#		}
		set_global_flag = ned_saved

	}
}

#Tully asks for wedding
country_event = {
	id = finland.18
	title = finland.18.t
	desc = finland.18.d
	picture = GFX_report_event_worried_french
	
	is_triggered_only = yes

	option = {
		name = finland.18.a
		ai_chance = { factor = 40 }
		FRA = { country_event = { id = france.29 days = 1 } }
		activate_mission = STR_wedding_is_happening
	}
	option = {
		name = finland.18.b
		ai_chance = { factor = 10 }
		FRA = { country_event = { id = france.30 days = 1 } }
	}
}

#Roselyn Stark
country_event = {
	id = finland.19
	title = finland.19.t
	desc = finland.19.d
	picture = GFX_report_event_ROM_mistress
	
	is_triggered_only = yes

	option = {
		name = finland.19.a
		ai_chance = { factor = 40 }
		add_ideas = STR_roselyn_stark
		load_oob = "FREY_STARK"
		hidden_effect = {
		AUS = {
			create_country_leader = {
			name = "Roselyn Stark"
			desc = "POLITICS_ROSELYN_STARK_DESC"
			picture = "gfx/leaders/AUS/Portrait_Roselyn_Stark.dds"
			expire = "1965.1.1"
			ideology = conservatism
			traits = {				
			}
				}
			}			
		}
#		FRA = { country_event = { id = france.29 days = 1 } }
	}
}

#Red Wedding
country_event = {
	id = finland.20
	title = finland.20.t
	desc = finland.20.d
	picture = GFX_report_event_japanese_soldiers_03
	
	is_triggered_only = yes

	immediate = {
		set_global_flag = killed_stark_red_wedding
	}

	option = {
		name = finland.20.a
		ai_chance = { factor = 40 }
			if = {
				limit = { FIN = { has_country_leader = { ruling_only = yes name = "Robb Stark" } } }
				remove_unit_leader = 2
			}
		kill_country_leader = yes
#		remove_unit_leader = 406
		retire_character = STR_greatjon
		add_timed_idea = { idea = STR_great_depression days = 178 }
		set_global_flag = red_wedding
	}
}

# The Battle is Lost
country_event = {
	id = finland.21
	title = finland.21.t
	desc = finland.21.d
	picture = GFX_report_event_german_parade_paris
	
	fire_only_once = yes
	
	trigger = {
		tag = FIN
		has_war_with = HOL
		NOT = { has_war_with = CAN }
		100 = { is_controlled_by = CAN }
		142 = { is_controlled_by = FIN }
		NOT = { FIN = { has_country_leader = { ruling_only = no name = "Jon Stark" } } }
		OR = {
		NOT = { 126 = { is_controlled_by = FIN } }
		surrender_progress > 0.7
		}
		HOL = {
			is_in_faction_with = ENG
		}
		NOT = {
			has_civil_war = yes
		}
	}

#	is_triggered_only = yes
	
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
#		set_global_flag = killed_stark_red_wedding
	}
	
	option = { # Evacuate royal family
		name = finland.21.a
		ai_chance = {
			factor = 55
			modifier = {
				factor = 100
				is_historical_focus_on = yes
			}
		}
#		trigger = { is_ai = no }
		set_global_flag = evacuated_stark
#		custom_effect_tooltip = france.10.a_tt
		AUS = { transfer_state = 100 }
		100 = {	add_core_of = AUS}
		CAN = { transfer_state = 142 }
		100 = { set_demilitarized_zone = no }
#		change_tag_from = AUS
		CAN = { country_event = canada.3 }
		hidden_effect = {
		AUS = {
			inherit_technology = FIN
			create_country_leader = {
				name = "Hodor"
				desc = "POLITICS_KURT_SCHUSCHNIGG_DESC"
				picture = "Portrait_Austria_Kurt_Schuschnigg.dds"
				expire = "1965.1.1"
				ideology = centrism
				traits = {
					#
				}
			}
			create_country_leader = {
				name = "Sansa Stark"
				desc = "POLITICS_SANSA_STARK_DESC"
				picture = "gfx/leaders/FIN/Portrait_Stark_Sansa.dds"

				expire = "1965.1.1"
				ideology = nazism
				traits = {
					#
				}
			}
			create_country_leader = {
				name = "Bran Stark"
				desc = "POLITICS_ALFRED_KLAHR_DESC"
				picture = "gfx/leaders/FIN/Portrait_Stark_Bran.dds"
				expire = "1965.1.1"
				ideology = marxism
				traits = {
					#
				}
			}
			}			
		}
	}
	option = { # Evacuate royal family
		name = finland.21.b
		ai_chance = {
			factor = 0
		}
		trigger = { is_ai = no }
		set_global_flag = evacuated_stark
#		custom_effect_tooltip = france.10.a_tt
		AUS = { transfer_state = 100 }
		100 = {	add_core_of = AUS}
		CAN = { transfer_state = 142 }
		100 = { set_demilitarized_zone = no }
		CAN = { country_event = canada.3 }
		AUS = { change_tag_from = FIN }
		hidden_effect = {
		AUS = {
			inherit_technology = FIN
			create_country_leader = {
				name = "Hodor"
				desc = "POLITICS_KURT_SCHUSCHNIGG_DESC"
				picture = "Portrait_Austria_Kurt_Schuschnigg.dds"
				expire = "1965.1.1"
				ideology = centrism
				traits = {
					#
				}
			}
			create_country_leader = {
				name = "Sansa Stark"
				desc = "POLITICS_SANSA_STARK_DESC"
				picture = "gfx/leaders/FIN/Portrait_Stark_Sansa.dds"

				expire = "1965.1.1"
				ideology = nazism
				traits = {
					#
				}
			}
			create_country_leader = {
				name = "Bran Stark"
				desc = "POLITICS_ALFRED_KLAHR_DESC"
				picture = "gfx/leaders/FIN/Portrait_Stark_Bran.dds"
				expire = "1965.1.1"
				ideology = marxism
				traits = {
					#
				}
			}
			}			
		}
	}
	option = { # Fight to the end
		name = finland.21.c
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

# Arya is back
country_event = {
	id = finland.22
	title = finland.22.t
	desc = finland.22.d
	picture = GFX_report_event_german_parade_paris
	
	fire_only_once = yes
	
	trigger = {
		tag = FIN
		FIN = { is_puppet = no }
		date > 1944.7.19
		has_start_date < 1944.07.02
		NOT = { has_global_flag = arya_returns }
	}
	
	mean_time_to_happen = {
		days = 2
	}

	immediate = { set_global_flag = arya_returns }
	
	option = { # Welcome Arya
		name = finland.22.a
		FIN = {
			create_corps_commander = {
				name = "Arya Stark"
				portrait_path = "gfx/leaders/AUS/Portrait_Arya_Stark.dds"
				traits = { trickster }
				skill = 2
			}
		}

	}
}

#Faction with King
country_event = {
	id = finland.23
	title = finland.23.t
	desc = finland.23.d
	picture = GFX_report_event_japanese_soldiers_03
	
	is_triggered_only = yes

	option = {
		name = finland.23.a
		ai_chance = { factor = 75 }
		ENG = {
			country_event = { days = 1 id = britain.2 }
		}
		if = {
			limit = { FIN = { is_in_faction = no } }
			FIN = {
				create_faction = "Royal Union of the North"
			}
		}
	}
	option = {
		name = finland.23.b
		ai_chance = { factor = 10 }
		ENG = {
			country_event = { days = 1 id = britain.3 }
		}
	}
}