Esempio n. 1
0
        public void Load(SaveGameData p_data)
        {
            m_items.Clear();
            Int32 num = p_data.Get <Int32>("ItemCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                EDataType    p_type       = (EDataType)p_data.Get <Int32>("Type" + i, 0);
                SaveGameData saveGameData = p_data.Get <SaveGameData>("Item" + i, null);
                if (saveGameData != null)
                {
                    try
                    {
                        BaseItem baseItem = ItemFactory.CreateItem(p_type);
                        baseItem.Load(saveGameData);
                        m_items.Add(baseItem);
                    }
                    catch (Exception ex)
                    {
                        LegacyLogger.Log(ex.ToString());
                    }
                }
            }
            SaveGameData saveGameData2 = p_data.Get <SaveGameData>("UpdateTime", null);

            if (saveGameData2 != null)
            {
                m_updateTime.Load(saveGameData2);
            }
            m_initialItemUpdateDone = p_data.Get <Boolean>("InitialItemUpdateDone", false);
        }
Esempio n. 2
0
        public void Load(SaveGameData p_data)
        {
            m_worldMapPoints.Clear();
            Int32 num = p_data.Get <Int32>("WorldMapCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                SaveGameData saveGameData = p_data.Get <SaveGameData>("WorldMapPoint" + i, null);
                if (saveGameData != null)
                {
                    Int32 num2 = saveGameData.Get <Int32>("StaticID", 0);
                    WorldMapPointStaticData staticData = StaticDataHandler.GetStaticData <WorldMapPointStaticData>(EDataType.WORLD_MAP, num2);
                    if (staticData != null)
                    {
                        WorldMapPoint worldMapPoint = new WorldMapPoint(staticData);
                        worldMapPoint.Load(saveGameData);
                        m_worldMapPoints.Add(num2, worldMapPoint);
                    }
                }
            }
            if (MapPointsLoaded != null)
            {
                MapPointsLoaded(this, EventArgs.Empty);
            }
        }
Esempio n. 3
0
 public override void Load(SaveGameData p_data)
 {
     base.Load(p_data);
     m_autoStartNPC  = p_data.Get <Int32>("AutoStartNPC", -1);
     m_startDialogID = p_data.Get <Int32>("StartDialogID", -1);
     m_showNpcs      = p_data.Get <Boolean>("ShowNpcs", true);
 }
 public void Load(SaveGameData p_data)
 {
     m_resistance = new Resistance[p_data.Get <Int32>("ResistanceCount", 0)];
     for (Int32 i = 0; i < m_resistance.Length; i++)
     {
         m_resistance[i]       = default(Resistance);
         m_resistance[i].Type  = p_data.Get <EDamageType>("DamageType" + i, EDamageType.PHYSICAL);
         m_resistance[i].Value = p_data.Get <Int32>("Value" + i, 1);
     }
 }
Esempio n. 5
0
        public void Load(SaveGameData p_data)
        {
            m_allMonsters.Clear();
            m_killedMonsters.Clear();
            m_questMonsters.Clear();
            m_newEntries.Clear();
            m_killedCoreMonsters = p_data.Get <Int32>("BestiaryKilledCoreMonsters", 0);
            Int32 num = p_data.Get <Int32>("BestiaryLength", 0);

            for (Int32 i = 0; i < num; i++)
            {
                Int32 p_key = p_data.Get <Int32>("BestiaryEntryMonsterKey" + i, 0);
                Int32 p_val = p_data.Get <Int32>("BestiaryEntryMonsterValue" + i, 0);
                AddKilledMonster(p_key, p_val, true);
            }
            Int32 num2 = p_data.Get <Int32>("BestiaryNewEntries", 0);

            for (Int32 j = 0; j < num2; j++)
            {
                m_newEntries.Add(p_data.Get <Int32>("BestiaryNewEntryKey" + j, 0));
            }
            Int32 num3 = p_data.Get <Int32>("BestiaryQuestMonsters", 0);

            for (Int32 k = 0; k < num3; k++)
            {
                Int32 p_key2 = p_data.Get <Int32>("BestiaryQuestMonsterKey" + k, 0);
                Int32 p_val2 = p_data.Get <Int32>("BestiaryQuestMonsterValue" + k, 0);
                AddKilledQuestMonster(p_key2, p_val2, true);
            }
        }
 public void Load(SaveGameData p_data)
 {
     if (p_data != null)
     {
         Int32 num = p_data.Get <Int32>("Count", 0);
         for (Int32 i = 0; i < num; i++)
         {
             Int32  p_type = p_data.Get <Int32>("buffType_" + i, 1);
             Single p_castersMagicFactor = p_data.Get <Single>("castersMagicValue_" + i, 1f);
             m_buffList.Add(BuffFactory.CreateMonsterBuff((EMonsterBuffType)p_type, p_castersMagicFactor));
         }
     }
 }
Esempio n. 7
0
        public override void Load(SaveGameData p_data)
        {
            base.Load(p_data);
            m_partyBuff     = p_data.Get <EPartyBuffs>("PartyBuff", EPartyBuffs.NONE);
            m_special       = p_data.Get <ERechargerSpecial>("Special", ERechargerSpecial.NONE);
            m_rechargerType = p_data.Get <ERechargerType>("RechargerType", ERechargerType.FOUNTAIN);
            SaveGameData saveGameData = p_data.Get <SaveGameData>("LastActivation", null);

            if (saveGameData != null)
            {
                m_lastActivationTime.Load(saveGameData);
            }
        }
        public override void Load(SaveGameData p_data)
        {
            m_conditions.Clear();
            base.Load(p_data);
            Int32 num = p_data.Get <Int32>("ConditionCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                ObjectCondition item;
                item.id          = p_data.Get <Int32>("ID" + i, 0);
                item.wantedState = p_data.Get <EInteractiveObjectState>("State" + i, EInteractiveObjectState.NONE);
                m_conditions.Add(item);
            }
        }
Esempio n. 9
0
        public void Load(SaveGameData p_data)
        {
            m_tokens.Clear();
            Int32 num = p_data.Get <Int32>("Count", 0);

            for (Int32 i = 0; i < num; i++)
            {
                Int32 num2 = p_data.Get <Int32>("TokenKey" + i, -1);
                Int32 num3 = p_data.Get <Int32>("TokenValue" + i, -1);
                if (num2 != -1 && num3 != -1)
                {
                    m_tokens.Add(num2, num3);
                }
            }
        }
Esempio n. 10
0
        public void Load(SaveGameData p_data)
        {
            Int32 num = p_data.Get <Int32>("FoundBooksCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                AddLoreBook(p_data.Get <Int32>("FoundBookID" + i, 0), true);
            }
            Int32 num2 = p_data.Get <Int32>("FoundBooksNewEntriesCount", 0);

            for (Int32 j = 0; j < num2; j++)
            {
                m_newEntries.Add(p_data.Get <Int32>("FoundBooksNewEntry" + j, 0));
            }
        }
Esempio n. 11
0
        public void Load(SaveGameData p_data)
        {
            m_buffs.Clear();
            Int32 num = p_data.Get <Int32>("Count", 0);

            for (Int32 i = 0; i < num; i++)
            {
                SaveGameData saveGameData = p_data.Get <SaveGameData>("Buff" + i, null);
                if (saveGameData != null)
                {
                    PartyBuff partyBuff = new PartyBuff();
                    partyBuff.Load(saveGameData);
                    m_buffs.Add(partyBuff);
                }
            }
        }
        public void LoadPrivilegesRewards()
        {
            SaveGameData saveGameData = new SaveGameData("PrivilegesRewards");

            LegacyLogic.Instance.WorldManager.SaveGameManager.LoadSaveGameData(saveGameData, "global2.lsg");
            m_privileges = new Int32[saveGameData.Get <Int32>("Count", 0)];
            for (Int32 i = 0; i < m_privileges.Length; i++)
            {
                m_privileges[i] = saveGameData.Get <Int32>("id" + i, 0);
            }
            m_rewards = new Int32[saveGameData.Get <Int32>("RewardsCount", 0)];
            for (Int32 j = 0; j < m_rewards.Length; j++)
            {
                m_rewards[j] = saveGameData.Get <Int32>("rewardId" + j, 0);
            }
        }
        public void Load(SaveGameData p_data)
        {
            Int32 num = p_data.Get <Int32>("OfferCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                Int32            p_staticID = p_data.Get <Int32>("OfferID" + i, 1);
                TradingItemOffer offerById  = GetOfferById(p_staticID);
                if (offerById != null)
                {
                    SaveGameData saveGameData = p_data.Get <SaveGameData>("Offer" + i, null);
                    if (saveGameData != null)
                    {
                        offerById.Load(saveGameData);
                    }
                }
            }
        }
Esempio n. 14
0
 public void Load(SaveGameData p_data)
 {
     Might        = p_data.Get <Int32>("Might", 1);
     Magic        = p_data.Get <Int32>("Magic", 1);
     Perception   = p_data.Get <Int32>("Perception", 1);
     Destiny      = p_data.Get <Int32>("Destiny", 1);
     Vitality     = p_data.Get <Int32>("Vitality", 1);
     Spirit       = p_data.Get <Int32>("Spirit", 1);
     HealthPoints = p_data.Get <Int32>("HealthPoints", 1);
     ManaPoints   = p_data.Get <Int32>("ManaPoints", 1);
 }
Esempio n. 15
0
        public void Load()
        {
            SaveGameData saveGameData = new SaveGameData("globalHints");

            LegacyLogic.Instance.WorldManager.SaveGameManager.LoadSaveGameData(saveGameData, "hints.lsg");
            for (Int32 i = 0; i < m_hints.Count; i++)
            {
                m_hints[i].Shown = saveGameData.Get <Boolean>("shown" + m_hints[i].StaticID, false);
            }
        }
Esempio n. 16
0
        public void Load(SaveGameData p_data)
        {
            if (m_tradingInventory != null)
            {
                m_tradingInventory.Load(p_data);
            }
            Int32 num = p_data.Get <Int32>("RestCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                m_restCount.Add(p_data.Get <ETargetCondition>("RestCountKey" + i, ETargetCondition.NONE), p_data.Get <Int32>("RestCountValue" + 1, 0));
            }
            m_dayCount.Clear();
            Int32 num2 = p_data.Get <Int32>("DayCount", 0);

            for (Int32 j = 0; j < num2; j++)
            {
                m_dayCount.Add(p_data.Get <ETargetCondition>("DayCountKey" + j, ETargetCondition.NONE), p_data.Get <Int32>("DayCountValue" + j, 0));
            }
        }
 public void Load(SaveGameData p_data)
 {
     foreach (Skill skill in m_availableSkills)
     {
         SaveGameData saveGameData = p_data.Get <SaveGameData>("Skill" + skill.StaticID, null);
         if (saveGameData != null)
         {
             skill.Load(saveGameData);
         }
     }
 }
Esempio n. 18
0
        public void Load(SaveGameData p_data)
        {
            Int32 num = p_data.Get <Int32>("NpcFactoryCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                Int32 num2 = p_data.Get <Int32>("NpcID" + i, 0);
                Npc   npc  = Get(num2);
                if (npc != null)
                {
                    SaveGameData saveGameData = p_data.Get <SaveGameData>("Npc" + i, null);
                    if (saveGameData != null)
                    {
                        npc.Load(saveGameData);
                    }
                    else
                    {
                        LegacyLogger.LogError("Fail load NPC savegame: " + num2);
                    }
                }
            }
        }
Esempio n. 19
0
        internal void Load(SaveGameData mapdata)
        {
            Clear();
            if (mapdata == null)
            {
                return;
            }
            MapNoteEventArgs mapNoteEventArgs = new MapNoteEventArgs(null, null);
            Int32            num = mapdata.Get <Int32>("MapCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                String       text         = mapdata.Get <String>("Map" + i, null);
                SaveGameData saveGameData = mapdata.Get <SaveGameData>("Notes" + i, null);
                if (text != null && saveGameData != null)
                {
                    MapNoteCollection mapNoteCollection = new MapNoteCollection();
                    m_MapNotes.Add(text, mapNoteCollection);
                    Int32 num2 = saveGameData.Get <Int32>("Count", 0);
                    for (Int32 j = 0; j < num2; j++)
                    {
                        Int32  num3  = saveGameData.Get <Int32>("Nx" + j, -1);
                        Int32  num4  = saveGameData.Get <Int32>("Ny" + j, -1);
                        String text2 = saveGameData.Get <String>("Nt" + j, null);
                        if (num3 != -1 && num4 != -1 && !String.IsNullOrEmpty(text2))
                        {
                            MapNote mapNote = new MapNote(text, new Position(num3, num4), text2);
                            mapNoteCollection.Add(new Position(num3, num4), mapNote);
                            if (AddedMapNote != null)
                            {
                                mapNoteEventArgs.MapID   = text;
                                mapNoteEventArgs.MapNote = mapNote;
                                AddedMapNote(this, mapNoteEventArgs);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 20
0
        public void Load(SaveGameData p_data)
        {
            Int32 num = p_data.Get <Int32>("HirelingCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                Int32 num2 = p_data.Get <Int32>("Hireling" + i, -1);
                if (num2 != -1)
                {
                    if (num2 == 203)
                    {
                        num2 = 210;
                    }
                    m_hirelings[i] = LegacyLogic.Instance.WorldManager.NpcFactory.Get(num2);
                    HirelingEventArgs p_eventArgs = new HirelingEventArgs(ETargetCondition.HIRE, m_hirelings[i], i);
                    LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.NPC_HIRELING_UPDATED, p_eventArgs);
                }
                else
                {
                    m_hirelings[i] = null;
                }
            }
        }
        internal void Load(SaveGameData p_data)
        {
            m_Existent = p_data.Get <Boolean>("Existent", false);
            Int32    x              = p_data.Get <Int32>("X", 0);
            Int32    y              = p_data.Get <Int32>("Y", 0);
            String   p_mapname      = p_data.Get <String>("MapName", null);
            String   p_locaKey      = p_data.Get <String>("LocaMapName", null);
            Int32    p_worldPointID = p_data.Get <Int32>("MapPointID", 0);
            Position p_position     = new Position(x, y);

            m_SpiritBeacon = new SpiritBeaconPosition(p_position, p_mapname, p_locaKey, p_worldPointID);
            LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.SPIRIT_BEACON_UPDATE, EventArgs.Empty);
        }
Esempio n. 22
0
 public void Load(SaveGameData p_data)
 {
     m_totalMinutes = p_data.Get <Int32>("TotalMinutes", 0);
 }
Esempio n. 23
0
 public override void Load(SaveGameData p_data)
 {
     base.Load(p_data);
     m_targetAttribute = p_data.Get <EPotionTarget>("TargetAttribute", EPotionTarget.MIGHT);
     m_value           = p_data.Get <Int32>("Value", 1);
 }
Esempio n. 24
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);
                }
            }
        }
Esempio n. 25
0
 public override void Load(SaveGameData p_data)
 {
     base.Load(p_data);
     CurrentAnim = p_data.Get <String>("CurrentAnim", String.Empty);
 }
Esempio n. 26
0
 public override void Load(SaveGameData p_data)
 {
     m_amount = p_data.Get <Int32>("Amount", 1);
 }
Esempio n. 27
0
 public override void Load(SaveGameData p_data)
 {
     m_firstFightRound = p_data.Get <Boolean>("FirstRound", true);
     m_lastCastedSpell = p_data.Get <EMonsterSpell>("LastCastedSpell", m_lastCastedSpell);
     m_state           = p_data.Get <EErebosState>("State", m_state);
 }