Esempio n. 1
0
        static void ReverseChain(QuestInformation ab)
        {
            if (ab.IsProcessed == true)
            {
                return;
            }
            if (ab.FollowUpQuest == 0)
            {
                ab.IsProcessed = true; return;
            }

            QuestInformation recursive;

            if (dict.TryGetValue(ab.FollowUpQuest, out recursive))
            {
                if (recursive.FollowUpQuest != ab.FollowUpQuest)
                {
                    ReverseChain(recursive);
                }
                uint QuestId1 = ab.FollowUpQuest;
                uint QuestId2 = recursive.FollowUpQuest;

                ab.FollowUpQuest        = QuestId2;
                recursive.FollowUpQuest = QuestId1;
                ab.IsProcessed          = true;
            }
        }
Esempio n. 2
0
        static void ProcessAllQuests()
        {
            using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
                using (XmlTextReader reader = new XmlTextReader(fs))
                {
                    string           value = null;
                    QuestInformation ab    = new QuestInformation();
                    while (reader.Read())
                    {
                        switch (reader.NodeType)
                        {
                        case XmlNodeType.Element:
                            value = null;
                            switch (reader.Name.ToLowerInvariant())
                            {
                            case "row": ab = new QuestInformation(); break;
                            }
                            break;

                        case XmlNodeType.Text:
                            value = reader.Value;
                            break;

                        case XmlNodeType.EndElement:
                            switch (reader.Name.ToLowerInvariant())
                            {
                            case "id": ab.QuestId = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "nextquest": ab.FollowUpQuest = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "reqclv": ab.ReqClvl = byte.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "zeny": ab.Zeny = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "rewardcexp": ab.RewardCexp = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "rewardjexp": ab.RewardJexp = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "rewardwexp": ab.RewardWexp = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "item1": ab.Item1 = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "itemcount1": ab.ItemCount1 = byte.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "item2": ab.Item2 = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "itemcount2": ab.ItemCount2 = byte.Parse(value, NumberFormatInfo.InvariantInfo); break;

                            case "row": dict.Add(ab.QuestId, ab); ab = null; break;
                            }
                            break;
                        }
                    }
                }
        }
Esempio n. 3
0
        static void ProcessAllQuests()
        {
            using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
            using (XmlTextReader reader = new XmlTextReader(fs))
            {

                string value = null;
                QuestInformation ab = new QuestInformation();
                while (reader.Read())
                {
                    switch (reader.NodeType)
                    {
                        case XmlNodeType.Element:
                            value = null;
                            switch (reader.Name.ToLowerInvariant())
                            {
                                case "row": ab = new QuestInformation(); break;
                            }
                            break;
                        case XmlNodeType.Text:
                            value = reader.Value;
                            break;
                        case XmlNodeType.EndElement:
                            switch (reader.Name.ToLowerInvariant())
                            {
                                case "id": ab.QuestId = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "nextquest": ab.FollowUpQuest = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "reqclv": ab.ReqClvl = byte.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "zeny": ab.Zeny = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "rewardcexp": ab.RewardCexp = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "rewardjexp": ab.RewardJexp = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "rewardwexp": ab.RewardWexp = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "item1": ab.Item1 = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "itemcount1": ab.ItemCount1 = byte.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "item2": ab.Item2 = uint.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "itemcount2": ab.ItemCount2 = byte.Parse(value, NumberFormatInfo.InvariantInfo); break;
                                case "row": dict.Add(ab.QuestId, ab); ab = null; break;
                            }
                            break;
                    }
                }
            }
        }
Esempio n. 4
0
        static void ReverseChain(QuestInformation ab)
        {
            if (ab.IsProcessed == true) return;
            if (ab.FollowUpQuest == 0) { ab.IsProcessed = true; return; }

            QuestInformation recursive;
            if (dict.TryGetValue(ab.FollowUpQuest, out recursive))
            {
                if (recursive.FollowUpQuest != ab.FollowUpQuest) ReverseChain(recursive);
                uint QuestId1 = ab.FollowUpQuest;
                uint QuestId2 = recursive.FollowUpQuest;

                ab.FollowUpQuest = QuestId2;
                recursive.FollowUpQuest = QuestId1;
                ab.IsProcessed = true;
            }
        }