Beispiel #1
0
        /// <summary>Loads the quest templates.</summary>
        /// <returns></returns>
        public static bool LoadAll()
        {
            if (!QuestMgr.Loaded)
            {
                QuestMgr.Templates = new QuestTemplate[30000];
                ContentMgr.Load <QuestTemplate>();
                ContentMgr.Load <QuestPOI>();
                ContentMgr.Load <QuestPOIPoints>();
                QuestMgr.CreateQuestRelationGraph();
                QuestMgr.EnsureCharacterQuestsLoaded();
                QuestMgr.AddSpellCastObjectives();
                if (ItemMgr.Loaded)
                {
                    ItemMgr.EnsureItemQuestRelations();
                }
                foreach (QuestTemplate template1 in QuestMgr.Templates)
                {
                    if (template1 != null)
                    {
                        ItemTemplate template2 = ItemMgr.GetTemplate(template1.SrcItemId);
                        if (template2 != null && template1.SrcItemId != (Asda2ItemId)0 &&
                            !template1.Starters.Contains((IQuestHolderEntry)template2))
                        {
                            template1.ProvidedItems.Add(new Asda2ItemStackDescription(template1.SrcItemId, 1));
                        }
                    }
                }

                QuestMgr.Loaded = true;
                QuestMgr.log.Debug("{0} Quests loaded.", QuestMgr._questCount);
            }

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Loads the quest templates.
        /// </summary>
        /// <returns></returns>
        public static bool LoadAll()
        {
            if (!Loaded)
            {
                new DBCReader <QuestXpConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_QUESTXP));
                new DBCReader <QuestRewRepConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_QUESTFACTIONREWARD));
                new DBCReader <QuestHonorInfoConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_TEAMCONTRIBUTIONPOINTS));
                Templates = new QuestTemplate[30000];

                ContentMgr.Load <QuestTemplate>();
                ContentMgr.Load <QuestPOI>();
                ContentMgr.Load <QuestPOIPoints>();
                CreateQuestRelationGraph();

                EnsureCharacterQuestsLoaded();
                AddSpellCastObjectives();

                // add Item quest starters & add collect quests to corresponding items
                if (ItemMgr.Loaded)
                {
                    ItemMgr.EnsureItemQuestRelations();
                }

                // add items to list of provided items
                foreach (var qTempl in Templates)
                {
                    if (qTempl != null)
                    {
                        var itemTempl = ItemMgr.GetTemplate(qTempl.SrcItemId);
                        if (itemTempl != null && qTempl.SrcItemId != 0 && !qTempl.Starters.Contains(itemTempl))
                        {
                            qTempl.ProvidedItems.Add(new ItemStackDescription(qTempl.SrcItemId, 1));
                        }
                    }
                }

                Loaded = true;

                log.Debug("{0} Quests loaded.", _questCount);
            }
            return(true);
        }