namespace = dvg_oceania

# Nouvelle Zealand
dvg_oceania.1 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.1.t
	desc = dvg_oceania.1.d
	flavor = dvg_oceania.1.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_capitalists_meeting.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		not = {
			has_variable = dvg_nouvelle_zealand
		}
	}
	
	
	# Yes, give them the go ahead.
	option = {
		name = dvg_oceania.1.a
		default_option = yes
		create_country = {
			tag = NVZ
			origin = this
			state = s:STATE_COOMALONG.region_state:BRG
			state = s:STATE_NOONGAR.region_state:BRG
			state = s:STATE_PITJANTJAJARA.region_state:BRG
			state = s:STATE_OODNATTA.region_state:BRG
			state = s:STATE_YONGJIA.region_state:BRG
			state = s:STATE_YOLNGU.region_state:BRG
		}
		hidden_effect = {
			c:BRG = {
				create_diplomatic_pact = {
					country = c:NVZ
					type = dominion
				}
				change_relations = {
					country = c:NVZ
					value = 100
				}
			}
			c:NVZ = {
				add_modifier = {
					name = dvg_whoo_land
					months = 120
				}
			}
			set_variable = dvg_nouvelle_zealand
		}
		ai_chance = {
			base = 1
		}

	}
}

# Unrailroaded Australia
dvg_oceania.2 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.2.t
	desc = dvg_oceania.2.d
	flavor = dvg_oceania.2.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		has_game_rule = australia_disgusting
		not = {
			has_variable = dvg_australia_unlocked_variable
		}
	}
	
	immediate = {
		
	}
	
	# Gamerule is set. Can now colonize Australia
	option = {
		name = dvg_oceania.2.a
		default_option = yes
		hidden_effect = {
			root = {
				add_technology_researched = dvgaustralia
			}
			set_variable = dvg_australia_unlocked_variable
		}
		ai_chance = {
			base = 1
		}

	}
}

# Noongar Colony
dvg_oceania.3 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.3.t
	desc = dvg_oceania.3.d
	flavor = dvg_oceania.3.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		has_game_rule = australia_railroaded
		exists = c:NNG
		root = {
			has_state_in_state_region = STATE_NOONGAR
		}
		NOT = {
			country_has_primary_culture = cu:aborigine
		}
	}
	
	immediate = {
		annex = c:NNG
	}
	
	# Noongar is kill! oh no
	option = {
		name = dvg_oceania.3.a
		default_option = yes
		custom_tooltip = {
			text = dvg_noongar_colony_tt
		}
		ai_chance = {
			base = 1
		}

	}
}

# Pitjantjajara Colony
dvg_oceania.4 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.4.t
	desc = dvg_oceania.3.d
	flavor = dvg_oceania.3.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		has_game_rule = australia_railroaded
		exists = c:PJT
		root = {
			has_state_in_state_region = STATE_COOMALONG
			has_state_in_state_region = STATE_NOONGAR
		}
		NOT = {
			country_has_primary_culture = cu:aborigine
		}
	}
	
	immediate = {
		annex = c:PJT
	}
	
	# Pitjantjajara is kill! oh no
	option = {
		name = dvg_oceania.3.a
		default_option = yes
		custom_tooltip = {
			text = dvg_pitjantjajara_colony_tt
		}
		ai_chance = {
			base = 1
		}

	}
}

# Yolngu Colony
dvg_oceania.5 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.5.t
	desc = dvg_oceania.3.d
	flavor = dvg_oceania.3.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		has_game_rule = australia_railroaded
		exists = c:YLN
		root = {
			has_state_in_state_region = STATE_YOLNGU
		}
		NOT = {
			country_has_primary_culture = cu:aborigine
		}
	}
	
	immediate = {
		annex = c:YLN
	}
	
	# Yolngu is kill! oh no
	option = {
		name = dvg_oceania.3.a
		default_option = yes
		custom_tooltip = {
			text = dvg_yolngu_colony_tt
		}
		ai_chance = {
			base = 1
		}

	}
}

# Nunga Colony
dvg_oceania.6 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.6.t
	desc = dvg_oceania.3.d
	flavor = dvg_oceania.3.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		has_game_rule = australia_railroaded
		exists = c:NUN
		root = {
			has_state_in_state_region = STATE_PITJANTJAJARA
		}
		NOT = {
			country_has_primary_culture = cu:aborigine
		}
	}
	
	immediate = {
		annex = c:NUN
	}
	
	# Nunga is kill! oh no
	option = {
		name = dvg_oceania.3.a
		default_option = yes
		custom_tooltip = {
			text = dvg_nunga_colony_tt
		}
		ai_chance = {
			base = 1
		}

	}
}

# Yamatji Colony
dvg_oceania.7 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.7.t
	desc = dvg_oceania.3.d
	flavor = dvg_oceania.3.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		has_game_rule = australia_railroaded
		exists = c:YMT
		root = {
			has_state_in_state_region = STATE_COOMALONG
		}
		NOT = {
			country_has_primary_culture = cu:aborigine
		}
	}
	
	immediate = {
		annex = c:YMT		
	}
	
	# Yamatji is kill! oh no
	option = {
		name = dvg_oceania.3.a
		default_option = yes
		custom_tooltip = {
			text = dvg_coomalong_colony_tt
		}
		ai_chance = {
			base = 1
		}

	}
}

# Kauri Colony If zhourao, they get it. If no zhourao, owner of kangaroo island gets it.
dvg_oceania.8 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.8.t
	desc = dvg_oceania.3.d
	flavor = dvg_oceania.3.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		has_game_rule = australia_railroaded
		exists = c:KAU
		OR = {
			AND = {
				NOT = {
					country_has_primary_culture = cu:aborigine
					exists = c:ZHR
				}
				root = {
					has_state_in_state_region = STATE_YONGJIA
				}
			}
			AND = {
				NOT = {
					country_has_primary_culture = cu:aborigine
				}
				exists = c:ZHR
				country_has_primary_culture = cu:zhourao
			}
		}
	}
	
	immediate = {
		annex = c:KAU
	}
	
	# Kauri is kill! oh no
	option = {
		name = dvg_oceania.3.a
		default_option = yes
		custom_tooltip = {
			text = dvg_kauri_colony_tt
		}
		ai_chance = {
			base = 1
		}

	}
}

# Integrate into New Zealand
dvg_oceania.9 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.9.t
	desc = dvg_oceania.9.d
	flavor = dvg_oceania.9.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	immediate = {
	}
	
	# Kauri is kill! oh no
	option = {
		name = dvg_oceania.9.a
		default_option = yes
		custom_tooltip = {
			text = dvg_new_zealand_tt
			s:STATE_YONGJIA.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_YOLNGU.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_YONGLING.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_QINGSHUI.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_XINXIANG.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_ZHENG_HE.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_WEIHUAI.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_TAITUNG.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_WEIZHOU.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_JINZHOU.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_WENCHENG.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_PARLEVAR.region_state:BRG = {
				set_state_owner = c:NVZ
			}
			s:STATE_GUANSHAN.region_state:BRG = {
				set_state_owner = c:NVZ
			}
		}
		ai_chance = {
			base = 1
		}

	}
}

# Propose to Yaluo scand
dvg_oceania.41 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.41.t
	desc = dvg_oceania.41.d
	flavor = dvg_oceania.41.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	immediate = {
	}
	
	# This could help us
	option = {
		name = dvg_oceania.41.a
		default_option = yes
		c:YLO = {
			trigger_event = { id = dvg_zhourao.4 }
		}
		ai_chance = {
			base = 1
		}

	}
}

# Yaluo lets us in!
dvg_oceania.42 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.42.t
	desc = dvg_oceania.42.d
	flavor = dvg_oceania.42.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	immediate = {
	}
	
	# This will bring us much wealth!
	option = {
		name = dvg_oceania.42.a
		default_option = yes
		add_modifier = {
			name = dvg_yaluo_trade
			days = 600
		}
		ai_chance = {
			base = 1
		}
	}
}

# Yaluo refuses us
dvg_oceania.43 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.43.t
	desc = dvg_oceania.43.d
	flavor = dvg_oceania.43.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	immediate = {
	}
	
	# Unfortunate
	option = {
		name = dvg_oceania.43.a
		default_option = yes
		ai_chance = {
			base = 1
		}
	}
}

# Yaluo lets us partially in
dvg_oceania.44 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.44.t
	desc = dvg_oceania.44.d
	flavor = dvg_oceania.44.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	immediate = {
	}
	
	# This will bring us wealth!
	option = {
		name = dvg_oceania.44.a
		default_option = yes
		add_modifier = {
			name = dvg_yaluo_trade
			days = 300
		}
		ai_chance = {
			base = 1
		}
	}
}

# Zhourao convention
dvg_oceania.50 = {
	type = country_event
	placement = ROOT

	title = dvg_oceania.50.t
	desc = dvg_oceania.50.d
	flavor = dvg_oceania.50.f

	event_image = {
		video = "gfx/event_pictures/asia_politician_parliament_motion.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
		exists = c:BRG
		exists = c:SCA
		exists = c:DUA
		exists = c:ZSA
		exists = c:MJN
		exists = c:YLO
		OR = {
			root = c:BRG
			root = c:SCA
			root = c:DUA
			root = c:ZSA
			root = c:MJN
			root = c:YLO
		}
		year < 1840	
		year > 1836
		not = {
			has_variable = dvg_zhourao_convention_held
		}
	}
	
	immediate = {
		set_variable = dvg_zhourao_convention_held
	}
	
	# Fair enough
	option = {
		name = dvg_oceania.50.a
		default_option = yes
		trigger = { 
			OR = {
				AND = {
					exists = c:BRG
					root = c:BRG
				}
				AND = {
					exists = c:SCA
					root = c:SCA
				}
				AND = {
					exists = c:DUA
					root = c:DUA
				}
			}
		}
		custom_tooltip = {
			text = dvg_zhourao_convention_tt
		}
		ai_chance = {
			base = 1
		}
	}
	
	# Fair enough
	option = {
		name = dvg_oceania.50.b
		trigger = { 
			OR = {
				AND = {
					exists = c:ZSA
					root = c:ZSA
				}
				AND = {
					exists = c:MJN
					root = c:MJN
				}
				AND = {
					exists = c:YLO
					root = c:YLO
				}
			}
		}
		custom_tooltip = {
			text = dvg_zhourao_convention_tt
		}
		ai_chance = {
			base = 1
		}
	}
}