Beispiel #1
0
        public void RepairObeliskQuest()
        {
            QuestStep step = GetStep(83);

            if (step.QuestState == EQuestState.INACTIVE)
            {
                return;
            }
            step = GetStep(90);
            if (step.QuestState != EQuestState.INACTIVE)
            {
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(790);
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(791);
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(792);
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(793);
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(794);
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(795);
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(796);
                LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(797);
                return;
            }
            Int32 num = 0;

            step = GetStep(83);
            if (step.QuestState == EQuestState.ACTIVE)
            {
                num++;
            }
            step = GetStep(84);
            if (step.QuestState == EQuestState.ACTIVE)
            {
                num++;
            }
            step = GetStep(85);
            if (step.QuestState == EQuestState.ACTIVE)
            {
                num++;
            }
            step = GetStep(86);
            if (step.QuestState == EQuestState.ACTIVE)
            {
                num++;
            }
            step = GetStep(87);
            if (step.QuestState == EQuestState.ACTIVE)
            {
                num++;
            }
            step = GetStep(88);
            if (step.QuestState == EQuestState.ACTIVE)
            {
                num++;
            }
            step = GetStep(89);
            if (step.QuestState == EQuestState.ACTIVE)
            {
                num++;
            }
            MapData mapData = LegacyLogic.Instance.WorldManager.MapData["theworld"];
            List <ObelisksStaticData> list = new List <ObelisksStaticData>(StaticDataHandler.GetIterator <ObelisksStaticData>(EDataType.OBELISKS));

            foreach (ObelisksStaticData obelisksStaticData in list)
            {
                if (num > 0)
                {
                    if (mapData.GetTerrainData(obelisksStaticData.Position).Visited)
                    {
                        LegacyLogic.Instance.WorldManager.Party.TokenHandler.AddTokenIfNull(obelisksStaticData.TokenID);
                    }
                    num--;
                }
            }
        }
Beispiel #2
0
        public void Load(SaveGameData p_data)
        {
            m_quests.Clear();
            Int32 num = p_data.Get <Int32>("Count", 0);

            for (Int32 i = 0; i < num; i++)
            {
                SaveGameData saveGameData = p_data.Get <SaveGameData>("QuestStep" + i, null);
                if (saveGameData != null)
                {
                    QuestStep questStep = new QuestStep();
                    questStep.Load(saveGameData);
                    if (questStep.StaticData != null)
                    {
                        m_quests.Add(questStep);
                    }
                }
            }
            AddDLCQuest(109);
            AddDLCQuest(111);
            AddDLCQuest(112);
            AddDLCQuest(114);
            AddDLCQuest(115);
            AddDLCQuest(116);
            AddDLCQuest(117);
            AddDLCQuest(118);
            AddDLCQuest(119);
            AddDLCQuest(120);
            if (GetStep(110) == null)
            {
                QuestStepStaticData staticData = StaticDataHandler.GetStaticData <QuestStepStaticData>(EDataType.QUEST_STEPS, 110);
                QuestStep           questStep2 = new QuestStep(staticData);
                QuestStep           step       = GetStep(3);
                if (step.QuestState == EQuestState.ACTIVE)
                {
                    if (step.GetObjective(4).QuestState == EQuestState.SOLVED)
                    {
                        step.QuestState       = EQuestState.SOLVED;
                        questStep2.QuestState = EQuestState.ACTIVE;
                    }
                }
                else
                {
                    questStep2.QuestState = step.QuestState;
                }
                questStep2.GetObjective(5).QuestState = step.GetObjective(5).QuestState;
                questStep2.GetObjective(6).QuestState = step.GetObjective(6).QuestState;
                questStep2.GetObjective(7).QuestState = step.GetObjective(7).QuestState;
                step.RemoveObjective(5);
                step.RemoveObjective(6);
                step.RemoveObjective(7);
                step.StaticData.UpdateFollowupStep(110);
                m_quests.Add(questStep2);
            }
            QuestStep step2 = GetStep(100);

            if (step2 != null)
            {
                QuestObjectiveStaticData staticData2 = StaticDataHandler.GetStaticData <QuestObjectiveStaticData>(EDataType.QUEST_OBJECTIVES, 167);
                QuestObjective           objective   = step2.GetObjective(167);
                objective.StaticData.SetMainObjective(staticData2.IsMainObjective);
                objective.StaticData.SetNpcID(staticData2.NpcID);
                objective.StaticData.SetTokenID(staticData2.TokenID);
            }
            step2 = GetStep(63);
            if (step2.QuestState == EQuestState.ACTIVE)
            {
                step2.Repair();
                if (step2.CheckFinished())
                {
                    FinalizeStep(step2);
                }
            }
        }