local advice = require "export_advice"
local historic_events = require "export_historic_events"
local scripting = require "EpisodicScripting"
local camera_pan = 0
local function OnFactionTurnStart(context)
if conditions.TurnNumber(context) == 1 then
if conditions.FactionName("cherokee", context) and conditions.FactionIsHuman("cherokee", context) then
scripting.game_interface:trigger_custom_mission("britain_protectorate",
"cherokee", "capture_city", 0, "Acadia", "", "main_mission_capture_city_text", "main_protectorate_new_spain_reward", 2000, "", context)
end
elseif conditions.TurnNumber(context) == 2 then
if conditions.FactionName("britain", context) and conditions.FactionIsHuman("britain", context) then
scripting.game_interface:trigger_custom_mission("britain_protectorate",
"britain", "protectorate_region_capture", 0, "georgia_usa+cherokee_territory+new_france", "", "mission_text_text_main_protectorate_thirteen_colonies_text", "mission_text_text_main_protectorate_thirteen_colonies_reward", 0, "thirteen_colonies", context)
elseif conditions.FactionName("spain", context) and conditions.FactionIsHuman("spain", context) then
scripting.game_interface:trigger_custom_mission("spain_protectorate", "spain", "protectorate_region_capture", 0, "trinidad_tobago+tejas+curacao", "", "mission_text_text_main_protectorate_new_spain_text", "mission_text_text_main_protectorate_new_spain_reward", 0, "new_spain", context)
elseif conditions.FactionName("france", context) and conditions.FactionIsHuman("france", context) then
scripting.game_interface:trigger_custom_mission("france_protectorate", "france", "protectorate_region_capture", 0, "michigan_territory+algonquin_territory+cherokee_territory", "", "mission_text_text_main_protectorate_louisiana_text", "mission_text_text_main_protectorate_louisiana_reward", 0, "louisiana", context)
end
elseif conditions.TurnNumber(context) == 5 then
scripting.game_interface:enable_auto_generated_missions(true)
end
if conditions.FactionName("britain", context) and not conditions.FactionIsHuman("britain", context) then
scripting.game_interface:grant_faction_handover("britain", "thirteen_colonies", 6, 15, context)
elseif conditions.FactionName("spain", context) and not conditions.FactionIsHuman("spain", context) then
scripting.game_interface:grant_faction_handover("spain", "new_spain", 6, 15, context)
elseif conditions.FactionName("france", context) and not conditions.FactionIsHuman("france", context) then
end
end
local function OnAdviceIssued(context)
-- 0013_Battle_Advice_Missile_Superiority_Thread
if conditions.AdviceJustDisplayed("-1875830202", context) then
scripting.HighlightComponent("button_melee", true)
-- 0065_Battle_Advice_Outnumbered_By_The_Enemy_Thread
elseif conditions.AdviceJustDisplayed("-758254518", context) then
scripting.HighlightComponent("button_withdraw", true)
-- 0077_Battle_Advice_Fire_At_Will_Button_Thread
elseif conditions.AdviceJustDisplayed("737354545", context) then
scripting.HighlightComponent("button_fire_at_will", true)