----------------------------------------------------
-- Build Borehole
----------------------------------------------------
ActionNode{function(quest, objective)
if (quest.PersistentData.HasBuiltBorehole == true) then
return BehaviorStatus.SUCCEEDED;
end
if(objective ~= nil and objective:GetType() == GameInfo.QuestObjectives["QUEST_OBJECTIVE_BUILD_BUILDING"].ID) then
-- Set epilogue
local buildingName = GameInfo.Buildings[MINE_TYPE].Description;
local cityData = quest.PersistentData.City;
local plot = Map.GetPlot(cityData.X, cityData.Y);
local city = plot:GetPlotCity();
objective:SetEpilogue(Locale.ConvertTextKey("TXT_KEY_QUEST_ACCLIMATION_OBJECTIVE_BUILD_BOREHOLE_EPILOGUE", city:GetName(), buildingName));
quest.PersistentData.HasBuiltBorehole = true;
return BehaviorStatus.SUCCEEDED;
end
-- find city
local city = QuestScript.CityNearCanyon(quest:GetOwner());
quest.PersistentData.City = {};
quest.PersistentData.City.X = city:GetX();
quest.PersistentData.City.Y = city:GetY();
-- Set the prologue
quest:SetPrologue(Locale.ConvertTextKey("TXT_KEY_QUEST_ACCLIMATION_PROLOGUE", city:GetName()));
-- objective
local buildingName = GameInfo.Buildings[MINE_TYPE].Description;
local newObjective = AddObjective(quest, "QUEST_OBJECTIVE_BUILD_BUILDING", MINE_TYPE, MINE_NUMBER_TO_BUILD, city:GetID());
return BehaviorStatus.IN_PROGRESS;
end},