Esempio n. 1
0
        public void Init()
        {
            int valid = 0;

            foreach (var quest in Data.Data.Quests.Values)
            {
                //For debug breakpoint
                if (quest.QuestId == 1306)
                {
                    //int x = 0;
                }

                QuestProcessor processor = new QuestProcessor(quest);
                Quests.Add(quest.QuestId, processor);

                if (quest.StartNpc.Length > 0)
                {
                    int fullId = int.Parse(quest.StartNpc);
                    if (!NpcStartQuests.ContainsKey(fullId))
                    {
                        NpcStartQuests.Add(fullId, new List <Quest>());
                    }
                    NpcStartQuests[fullId].Add(quest);
                }
                else
                {
                    if (!AutoStartQuests.ContainsKey(quest.NeedLevel))
                    {
                        AutoStartQuests.Add(quest.NeedLevel, new List <Quest>());
                    }

                    AutoStartQuests[quest.NeedLevel].Add(quest);
                }

                valid++;

                foreach (var step in processor.Steps)
                {
                    if (step.GetType().Name.Equals("QStepDefault"))
                    {
                        valid--;
                        break;
                    }
                }
            }

            Log.Info("QuestEngine: Valid quests: {0} / {1}", valid, Quests.Count);
        }
Esempio n. 2
0
        public void Init()
        {
            int valid = 0;

            foreach (var quest in Data.Data.Quests.Values)
            {
                //For debug breakpoint
                if (quest.QuestId == 1306)
                {
                    //int x = 0;
                }

                QuestProcessor processor = new QuestProcessor(quest);
                Quests.Add(quest.QuestId, processor);

                if (quest.StartNpc.Length > 0)
                {
                    int fullId = int.Parse(quest.StartNpc);
                    if (!NpcStartQuests.ContainsKey(fullId))
                        NpcStartQuests.Add(fullId, new List<Quest>());
                    NpcStartQuests[fullId].Add(quest);
                }
                else
                {
                    if (!AutoStartQuests.ContainsKey(quest.NeedLevel))
                        AutoStartQuests.Add(quest.NeedLevel, new List<Quest>());

                    AutoStartQuests[quest.NeedLevel].Add(quest);
                }

                valid++;

                foreach (var step in processor.Steps)
                {
                    if (step.GetType().Name.Equals("QStepDefault"))
                    {
                        valid--;
                        break;
                    }
                }
            }

            Logger.WriteLine(LogState.Info,"QuestEngine: Valid quests: {0} / {1}", valid, Quests.Count);
        }