scripted_diplomatic_actions = {

	EAI_stockpile_diplomacy = {
	
        allowed = { always = yes }

        visible = { 
            OR = { 
                FROM = { OR = { is_in_faction_with = ROOT is_subject_of = ROOT } }
                ROOT = { is_subject_of = FROM } 
                FROM = { has_war_together_with = ROOT }
                AND = {
					FROM = { has_government = ROOT }
					NOT = { has_government = neutrality }
				}
            }
        }

        selectable = { 
            hidden_trigger = {
                NOT = { 
                    ROOT = { has_country_flag = EAI_config_STOCKPILE } 
                } 
            }
        }

        show_acceptance_on_action_button = no

        icon = 1

        complete_effect = {

            ROOT = { 
                EAI_set_stockpile_variables = yes
                set_country_flag = EAI_config_STOCKPILE 
            }

            FROM = { set_variable = { ROOT.EAI_configuration_target = THIS.id } }
		}

        ai_acceptance = {
			EAI_diplomacy_action_opinion_modifier = {
                base = 0

                modifier = {
                    add = 1
                    FROM = { has_opinion = { target = ROOT value > 50 } }
                }
            }
            DR_FACTION_SAME_WAR = {
                base = 0

                modifier = {
                    add = 1
                    FROM = { has_war_together_with = ROOT }
                }
            }
		}

        ai_desire = {
			factor = -1
		}
	}
}