Esempio n. 1
0
        private static void LoadQuests()
        {
            string loaded;

            byte[] dec;
            System.IO.StreamReader temp_stream;
            System.IO.MemoryStream mem_stream;

            try
            {
                dec = GetData(data_questname, "D_d/-pmzRPnC|!mS");

                mem_stream = new System.IO.MemoryStream(dec);
                temp_stream = new System.IO.StreamReader((System.IO.Stream)mem_stream);

                int version = Util.GetInt32(temp_stream.ReadLine());
                if (version < Globals.MinDataPack)
                {
                    System.Windows.Forms.MessageBox.Show("questname.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }
                
                Globals.questlist = new SortedList();
                Globals.questlist.Capacity = Globals.COUNT_QUESTS;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    QuestName qst_inf = new QuestName();

                    qst_inf.Parse(loaded);

                    Globals.questlist.Add(qst_inf.ID * Globals.ID_OFFSET + qst_inf.quest_prog, qst_inf);
                }

                mem_stream.Close();
                temp_stream.Close();

                //Add_Text("loaded quests", Globals.Red);
            }
            catch
            {
                Globals.l2net_home.Add_PopUpError("failed to load data\\questname.txt");
            }

            dec = null;
        }