コード例 #1
0
ファイル: ItemTable.cs プロジェクト: sortaloc/DCNC-Tools
        public void Load(string fileName)
        {
            var tdfFile = new TdfFile();

            tdfFile.Load(fileName);

            using (var reader = new BinaryReaderExt(new MemoryStream(tdfFile.ResTable)))
            {
                for (var row = 0; row < tdfFile.Header.Row; row++)
                {
                    //i_n_00026,i_n_00026,partsbox,열려있는 파츠 박스,n/a,n/a,n/a,하이퍼 파츠를 넣을 수 있게 열려있는 파츠 박스.,100,10,n/a,n/a,n/a,0,False,False,False,
                    var item = new UseItem();
                    item.Id       = reader.ReadUnicode();     //i_n_00019 <- ID
                    item.Category = reader.ReadUnicode();     //accelpointup <-- TYPE
                    item.Name     = reader.ReadUnicode();     //가속 향상제 <-- NAME
                    reader.ReadUnicode();                     // ig_n_B <-- GROUPID
                    reader.ReadUnicode();                     // n/a, i_n_00003 <-- NextID Name
                    reader.ReadUnicode();                     // n/a, 10 <-- Roundnum?
                    item.Description  = reader.ReadUnicode(); // 가속포인트를 50 초간 30 포인트 올려줌 <-- Description?
                    item.BuyValue     = reader.ReadUnicode(); // 100 <-- Cost?
                    item.SellValue    = reader.ReadUnicode(); // 10 <-- Sell?
                    item.MaxStack     = reader.ReadUnicode(); // 30
                    item.StatModifier = reader.ReadUnicode(); // 50
                    item.CooldownTime = reader.ReadUnicode(); // n/a, 0
                    item.Duration     = reader.ReadUnicode(); // 0, /na
                    item.PartsShop    = reader.ReadUnicode();
                    item.Sendable     = reader.ReadUnicode();
                    item.Auctionable  = reader.ReadUnicode();
                    UseItemList.Add(item);

                    /*
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * UseItemTypeStrToVar(&src, &v50.UseInfo.Type);
                     * XiTDFRead::GetString(&v53, v50.Name, 56);
                     * XiTDFRead::GetString(&v53, v50.GroupID, 56);
                     * XiTDFRead::GetString(&v53, v50.NextID.m_Name, 56);
                     * v50.RoundNum = 0;
                     * XiTDFRead::GetULong(&v53, &v50.RoundNum);
                     * if ( !v50.RoundNum )
                     * v50.RoundNum = 99;
                     * XiTDFRead::GetULong(&v53, &v50.Cost);
                     * XiTDFRead::GetULong(&v53, &v50.Sell);
                     * XiTDFRead::GetULong(&v53, &v50.UseInfo.Value);
                     * XiTDFRead::GetULong(&v53, &v50.UseInfo.Time);
                     * XiTDFRead::GetULong(&v53, &v50.Time);
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * if ( !wcscmp(&src, L"True") )
                     * v50.Shop = 1;
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * if ( !wcscmp(&src, L"True") )
                     * v50.Trade = 1;
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * if ( !wcscmp(&src, L"True") )
                     * v50.Auction = 1;
                     */
                }
            }
        }
コード例 #2
0
ファイル: ItemTable.cs プロジェクト: sortaloc/DCNC-Tools
        /*[XmlArray(ElementName = "Item")]
         * [XmlArrayItem("BasicItem", typeof(BasicItem))]
         * [XmlArrayItem("Item", typeof(Item))]
         * [XmlArrayItem("UseItem", typeof(UseItem))]
         * public List<BasicItem> ItemList = new List<BasicItem>();*/

        public void Load(string fileName)
        {
            var tdfFile = new TdfFile();

            tdfFile.Load(fileName);

            using (var reader = new BinaryReaderExt(new MemoryStream(tdfFile.ResTable)))
            {
                for (var row = 0; row < tdfFile.Header.Row; row++)
                {
                    var item = new Item();
                    // TODO: If US, this doesn't exist for some reason?!
                    //reader.ReadUnicode(); // Empty
                    item.Category = reader.ReadUnicode();          // Type
                    reader.ReadUnicode();                          // Set Type
                    item.Id = reader.ReadUnicode();                // IDname
                    reader.ReadUnicode();                          // Group id
                    item.Name = reader.ReadUnicode();              // Name
                    reader.ReadUnicode();                          // ???
                    //item.Function
                    item.Grade         = reader.ReadUnicode();     // Grade
                    item.RequiredLevel = reader.ReadUnicode();     // Reqlevel
                    reader.ReadUnicode();                          //???
                    //item.NextState
                    item.BasePoints        = reader.ReadUnicode(); // Value
                    item.BasePointModifier = reader.ReadUnicode(); // Min
                    item.BasePointVariable = reader.ReadUnicode(); // max
                    item.BuyValue          = reader.ReadUnicode(); // Cost
                    item.SellValue         = reader.ReadUnicode(); // Sell
                    reader.ReadUnicode();                          // Next id
                    item.PartsShop   = reader.ReadUnicode();
                    item.Sendable    = reader.ReadUnicode();
                    item.Auctionable = reader.ReadUnicode();
                    reader.ReadUnicode();                    // Set rate
                    item.Description = reader.ReadUnicode(); // Set desc
                    item.PartAssist  = reader.ReadUnicode(); // Set assist
                    //
                    item.ExpirationTime = reader.ReadUnicode();

                    // US Only
                    reader.ReadUnicode(); // Jewel Type
                    reader.ReadUnicode(); // Unknown
                    ItemList.Add(item);
                }
            }
        }
コード例 #3
0
        public void Load(string fileName)
        {
            var tdfFile = new TdfFile();

            tdfFile.Load(fileName);

            using (var reader = new BinaryReaderExt(new MemoryStream(tdfFile.ResTable)))
            {
                for (var row = 0; row < tdfFile.Header.Row; row++)
                {
                    var quest = new QuestTable.Quest();
                    quest.Id          = reader.ReadUnicode();
                    quest.TableIndex  = Convert.ToInt32(reader.ReadUnicode()) - 1;
                    quest.MissionType = reader.ReadUnicode();
                    //quest.Title = reader.ReadUnicode();
                    //quest.IntroPrompt = reader.ReadUnicode();

                    /*quest.Objective1 = reader.ReadUnicode();
                    *  quest.Objective2 = reader.ReadUnicode();
                    *  quest.Objective3 = reader.ReadUnicode();
                    *  quest.Objective4 = reader.ReadUnicode();
                    *  quest.Objective5 = reader.ReadUnicode();*/

                    // Total: 79, read until 74, from 2
                    for (int i = 3; i < 75; i++)
                    {
                        reader.ReadUnicode(); // Ignore everything.
                    }

                    quest.Experience  = Convert.ToInt32(reader.ReadUnicode());
                    quest.Mito        = Convert.ToInt32(reader.ReadUnicode());
                    quest.RewardItem1 = reader.ReadUnicode();
                    quest.RewardItem2 = reader.ReadUnicode();
                    quest.RewardItem3 = reader.ReadUnicode();
                    QuestList.Add(quest);
                    Console.WriteLine($"Quest added {quest.Id}");
                }
            }

            Console.WriteLine($"Quests added: {QuestList.Count}");
            Console.WriteLine($"Quest #1: {QuestList[0].Id}, Exp: {QuestList[0].Experience}, Mito: {QuestList[0].Mito}");
        }