﻿je_eastern_frontier = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/event_icons/event_map.dds"

	group = je_group_objectives

    scripted_button = greater_khorasan_button
    scripted_button = persian_baluchistan_button
    scripted_button = persia_british_aid_button
    scripted_button = persia_russian_aid_button
    scripted_button = persia_resettle_merv_button

    immediate = {
        s:STATE_HERAT = {
            save_scope_as = herat_scope
        }
        s:STATE_MERZ = {
            save_scope_as = merv_scope
        }
        s:STATE_KABUL = {
            save_scope_as = kabul_scope
        }
        s:STATE_UZBEKIA = {
            save_scope_as = uzbekia_scope
        }
        s:STATE_KHIVA = {
            save_scope_as = khiva_scope
        }
        c:PER ?= {
            save_scope_as = persia_scope
        }
        c:GBR ?= {
            save_scope_as = britain_scope
        }
        c:RUS ?= {
            save_scope_as = russia_scope
        }
        c:TRM ?= {
            save_scope_as = turkmenia_scope
        }
        cu:persian = {
            save_scope_as = persian_culture
        }
        cu:turkmen = {
            save_scope_as = turkmen_culture
        }
    }

	complete = {
        custom_tooltip = {
            text = je_eastern_frontier_tt_1 # Todo PRCAL-14501 Needs state highlighting
            country_or_subject_owns_entire_state_region = STATE_HERAT
            country_or_subject_owns_entire_state_region = STATE_KABUL
            country_or_subject_owns_entire_state_region = STATE_KANDAHAR
            country_or_subject_owns_entire_state_region = STATE_BALKH
            country_or_subject_owns_entire_state_region = STATE_CENTRAL_HIGHLANDS
            country_or_subject_owns_entire_state_region = STATE_MERZ
            country_or_subject_owns_entire_state_region = STATE_NORTHERN_BALUCHISTAN
        }
        custom_tooltip = {
            text = je_eastern_frontier_tt_2 # Todo PRCAL-14501 Needs state highlighting
            country_or_subject_owns_entire_state_region = STATE_TURKMENIA
            country_or_subject_owns_entire_state_region = STATE_KHIVA
        }
        custom_tooltip = {
            text = je_eastern_frontier_tt_3 # Todo PRCAL-14501 Needs state highlighting
            country_or_subject_owns_entire_state_region = STATE_FERGANA
            country_or_subject_owns_entire_state_region = STATE_TAJIKISTAN
            country_or_subject_owns_entire_state_region = STATE_UZBEKIA
        }
        custom_tooltip = {
            text = je_eastern_frontier_tt_4
            has_variable = restoration_of_merv_var
        }
	}

	on_complete = {
        trigger_event = { id = persia_events.1 popup = yes }
        hidden_effect = {
            set_variable = iranzamin_achievement
        }
	}

	weight = 1000
	transferable = yes
}
