Exemplo n.º 1
0
 private void AddDLCQuest(Int32 p_step)
 {
     if (GetStep(p_step) == null)
     {
         QuestStepStaticData staticData = StaticDataHandler.GetStaticData <QuestStepStaticData>(EDataType.QUEST_STEPS, p_step);
         QuestStep           item       = new QuestStep(staticData);
         m_quests.Add(item);
     }
 }
Exemplo n.º 2
0
 public QuestStep(QuestStepStaticData p_data) : this()
 {
     if (p_data == null)
     {
         throw new ArgumentNullException("p_data");
     }
     m_staticData = p_data;
     m_questState = EQuestState.INACTIVE;
     String[] array = m_staticData.Objectives.Split(new Char[]
     {
         ','
     });
     for (Int32 i = 0; i < array.Length; i += 2)
     {
         QuestObjective item = new QuestObjective(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
         m_objectives.Add(item);
     }
 }
Exemplo n.º 3
0
        public LootHandler(QuestStep p_quest)
        {
            m_quest = p_quest;
            QuestStepStaticData staticData = p_quest.StaticData;

            m_dropGoldChance              = staticData.DropGoldChance;
            m_dropGoldAmount              = staticData.DropGoldAmount;
            m_modelProbabilities          = staticData.DropModelLevels;
            m_dropItemChance              = staticData.DropItemChance;
            m_dropItemPrefixChance        = staticData.DropItemPrefixChance;
            m_dropItemSuffixChance        = staticData.DropItemSuffixChance;
            m_dropItemPrefixProbabilities = staticData.PrefixProbabilities;
            m_dropItemSuffixProbabilities = staticData.SuffixProbabilities;
            m_dropItemSpecificationList   = staticData.DropItemSpecificationList;
            m_steadyLoot = staticData.SteadyLoot;
            m_XpReward   = staticData.RewardXP;
            m_tokenIDs   = staticData.TokenID;
        }
Exemplo n.º 4
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);
                }
            }
        }