コード例 #1
0
 public QuestObjective(Int32 staticID, Int32 count)
 {
     m_staticData            = StaticDataHandler.GetStaticData <QuestObjectiveStaticData>(EDataType.QUEST_OBJECTIVES, staticID);
     m_currentCounter        = 0;
     m_maxCounter            = count;
     m_questState            = EQuestState.INACTIVE;
     m_activationTime        = default(MMTime);
     m_currentStepsOnTerrain = 0;
 }
コード例 #2
0
ファイル: QuestHandler.cs プロジェクト: blockspacer/MMXLegacy
        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);
                }
            }
        }