示例#1
0
        public static void GoEqCus()
        {
            File.Copy(SOURCE_FILE_EQ_CUS_BASE, TARGET_FILE_EQ_CUS_BASE, true);

            var instance = EqCus.LoadData(TARGET_FILE_EQ_CUS_BASE);
            var items    = instance.GetStructList();

            foreach (WeaponType weaponType in Enum.GetValues(typeof(WeaponType)))
            {
                var           i       = (ushort)items.Count;
                EqCus.Entries newItem = null;

                foreach (var kvp in DataHelper.weaponIndexNameLookup[weaponType]["eng"])
                {
                    if (IsValid(kvp))
                    {
                        continue;
                    }

                    newItem = new EqCus.Entries {
                        Equipment_Category_Weapon = weaponType,
                        Equipment_Index_Weapon    = (ushort)kvp.Key,
                        Monster_Unlock            = -1,
                        Story_Unlock             = 1,
                        Needed_Item_Id_to_Unlock = 888,
                        Mat_1_Id      = 888,
                        Mat_1_Count   = 1,
                        Unk_2         = 1,
                        Child_index_1 = ++i,
                        Item_Rank     = CharmRankType.High_Rank
                    };
                    items.Add(newItem);
                }

                if (newItem != null)
                {
                    newItem.Child_index_1 = 0;
                }
            }

            instance.SaveFile(TARGET_FILE_EQ_CUS_BASE);
        }
        private void Btn_cost_cheat_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(targetFile))
            {
                return;
            }

            if (!targetFileType.Is(typeof(Armor),
                                   typeof(CustomParts),
                                   typeof(CustomPartsR),
                                   typeof(EqCrt),
                                   typeof(EqCus),
                                   typeof(Item),
                                   typeof(IWeapon),
                                   typeof(NewLimitBreak),
                                   typeof(NewLimitBreakR),
                                   typeof(RodInsect)))
            {
                return;
            }

            foreach (var item in items)
            {
                switch (item)
                {
                case Item _: {
                    Item itm = item;
                    if (itm.Buy_Price > 0)
                    {
                        itm.Buy_Price = 1;
                    }
                    break;
                }

                case Armor _: {
                    Armor armor = item;
                    if (armor.Cost > 0)
                    {
                        armor.Cost = 1;
                    }
                    break;
                }

                case IWeapon _: {
                    IWeapon weapon = item;
                    if (weapon.Cost > 0)
                    {
                        weapon.Cost = 1;
                    }
                    break;
                }

                case EqCrt _: {
                    EqCrt eqCrt = item;
                    if (eqCrt.Mat_1_Count > 0)
                    {
                        eqCrt.Mat_1_Count = 1;
                    }
                    if (eqCrt.Mat_2_Count > 0)
                    {
                        eqCrt.Mat_2_Count = 1;
                    }
                    if (eqCrt.Mat_3_Count > 0)
                    {
                        eqCrt.Mat_3_Count = 1;
                    }
                    if (eqCrt.Mat_4_Count > 0)
                    {
                        eqCrt.Mat_4_Count = 1;
                    }
                    break;
                }

                case EqCus _: {
                    EqCus eqCus = item;
                    if (eqCus.Mat_1_Count > 0)
                    {
                        eqCus.Mat_1_Count = 1;
                    }
                    if (eqCus.Mat_2_Count > 0)
                    {
                        eqCus.Mat_2_Count = 1;
                    }
                    if (eqCus.Mat_3_Count > 0)
                    {
                        eqCus.Mat_3_Count = 1;
                    }
                    if (eqCus.Mat_4_Count > 0)
                    {
                        eqCus.Mat_4_Count = 1;
                    }
                    break;
                }

                case NewLimitBreakR _: {
                    NewLimitBreakR newLimitBreakR = item;
                    if (newLimitBreakR.Mat_1_Count > 0)
                    {
                        newLimitBreakR.Mat_1_Count = 1;
                    }
                    if (newLimitBreakR.Mat_2_Count > 0)
                    {
                        newLimitBreakR.Mat_2_Count = 1;
                    }
                    if (newLimitBreakR.Mat_3_Count > 0)
                    {
                        newLimitBreakR.Mat_3_Count = 1;
                    }
                    if (newLimitBreakR.Mat_4_Count > 0)
                    {
                        newLimitBreakR.Mat_4_Count = 1;
                    }
                    break;
                }

                case NewLimitBreak _: {
                    NewLimitBreak newLimitBreak = item;
                    if (newLimitBreak.Research_Cost_r10_ > 0)
                    {
                        newLimitBreak.Research_Cost_r10_ = 1;
                    }
                    if (newLimitBreak.Research_Cost_r11_ > 0)
                    {
                        newLimitBreak.Research_Cost_r11_ = 1;
                    }
                    if (newLimitBreak.Research_Cost_r12_ > 0)
                    {
                        newLimitBreak.Research_Cost_r12_ = 1;
                    }
                    if (newLimitBreak.Aug_Slot_Cost > 1)
                    {
                        newLimitBreak.Aug_Slot_Cost = 1;
                    }
                    break;
                }

                case CustomParts _: {
                    CustomParts customParts = item;
                    if (customParts.Craft_Cost > 0)
                    {
                        customParts.Craft_Cost = 1;
                    }
                    break;
                }

                case CustomPartsR _: {
                    CustomPartsR customPartsR = item;
                    if (customPartsR.Mat_1_Count > 0)
                    {
                        customPartsR.Mat_1_Count = 1;
                    }
                    if (customPartsR.Mat_2_Count > 0)
                    {
                        customPartsR.Mat_2_Count = 1;
                    }
                    if (customPartsR.Mat_3_Count > 0)
                    {
                        customPartsR.Mat_3_Count = 1;
                    }
                    if (customPartsR.Mat_4_Count > 0)
                    {
                        customPartsR.Mat_4_Count = 1;
                    }
                    break;
                }

                case RodInsect _: {
                    RodInsect rodInsect = item;
                    if (rodInsect.Craft_Cost > 0)
                    {
                        rodInsect.Craft_Cost = 1;
                    }
                    break;
                }
                }
            }
        }