Exemplo n.º 1
0
            static void Postfix(ItemDataMgr __instance, ref List <ItemBaseConfData> ___itemBaseList, ref List <EquipmentItemConfData> ___equipmentDataList)
            {
                if (!enabled)
                {
                    return;
                }
                int itemIds   = 42000000;
                int nameIds   = 42000000;
                int sourceIds = 4200;

                if (settings.includeSpecialWeapons)
                {
                    int storeId = storeIds[settings.specialWeaponStore];
                    Dbgl($"special weapons store {storeId}");
                    weapons = new List <Weapon> {
                        new Weapon(1001999, productIds++, 1, -1, "-1", storeId, settings.unknownWeaponChance),     // nameless
                        new Weapon(1001011, productIds++, 1, -1, "-1", storeId, settings.waterSwordChance),        // Waterfall
                        //new Weapon(1001010,productIds++,1,-1,"-1", storeId, 0.5f), //Rogue Knight
                        new Weapon(1001012, productIds++, 1, -1, "-1", storeId, settings.purpleHazeChance),        // Purple Haze
                        new Weapon(1001402, productIds++, 1, -1, "-1", storeId, settings.InflateableHammerChance), // Inflateable Hammer
                        new Weapon(1001000, productIds++, 1, -1, "-1", storeId, settings.DevDaggerChance),         // Dev's Dagger
                    };
                }

                for (int i = 0; i < ___itemBaseList.Count; i++)
                {
                    if (___itemBaseList[i].ID == 1001999)
                    {
                        ___itemBaseList[i].BuyPrice = 1000000;
                    }
                }


                foreach (WeaponItem item in weaponItems)
                {
                    nameDesc.Add(nameIds, item.name);
                    nameDesc.Add(nameIds + 1, item.description);
                    nameDesc.Add(nameIds + 2, item.effect);
                    nameDesc.Add(nameIds + 3, storeNames[item.storeId]);
                    sourceStrings.Add(sourceIds, nameIds + 3);

                    ItemBaseConfData itemConf = new ItemBaseConfData()
                    {
                        ID               = itemIds,
                        NameID           = nameIds,
                        Explain_one      = nameIds + 1,
                        BuyPrice         = item.buyPrice,
                        SellPrice        = item.sellPrice,
                        ExhibitModelPath = item.dropModelPath,
                        giftModelPath    = item.dropModelPath,
                        displayScale     = item.displayScale,
                        ItemType         = new ItemType[] { ItemType.Equipment },

                        sourceIndex = new int[] { sourceIds },
                        orderIndex  = item.orderIndex,

                        ItemFunctionID     = itemIds,
                        StackLimitedNumber = 1,
                        isGift             = 0,
                        rareLv             = 0,
                        reputationModify   = 0,

                        intendType      = item.intendType,
                        skillIds        = item.skillIds,
                        alwaysOnHand    = item.alwaysOnHand,
                        holdInBothHands = item.holdInBothHands,
                        energy          = -1,
                        hotValue        = 0,
                        recycleTag      = "1",
                        Effect_Desc_ID  = nameIds + 2,
                        HaveIcon        = true,
                        CanPickup       = true,
                        CanDiscard      = true,
                        CanSell         = true,
                    };

                    typeof(ItemBaseConfData).GetField("iconPath", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(itemConf, item.iconPath);
                    typeof(ItemBaseConfData).GetField("ModelPath", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(itemConf, item.modelPath);
                    typeof(ItemBaseConfData).GetField("DropModelPathMale", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(itemConf, item.dropModelPath);

                    ___itemBaseList.Add(itemConf);

                    EquipmentItemConfData equipConf = new EquipmentItemConfData()
                    {
                        id                  = itemIds,
                        equipType           = 0,
                        durabilityMax       = 100,
                        durabilityCost      = 0,
                        repairRate          = 1,
                        attack              = item.attack,
                        defense             = item.defense,
                        critical            = item.critical,
                        antiCritical        = item.antiCritical,
                        hpMax               = item.hpMax,
                        cpMax               = item.cpMax,
                        attackType          = AttackType.Melee,
                        digGridCount        = item.digGridCount,
                        digIntensity        = item.digIntensity,
                        Rate                = item.rate,
                        dateForce           = 0,
                        meleeCriticalAmount = item.meleeCriticalAmount,
                        rangeCriticalAmount = 0,
                    };

                    ___equipmentDataList.Add(equipConf);

                    weapons.Add(new Weapon(itemIds, productIds++, 1, -1, "-1", item.storeId, item.chance));

                    itemIds++;
                    nameIds += 4;
                    sourceIds++;
                }
            }
Exemplo n.º 2
0
            static void Postfix(ItemDataMgr __instance, ref List <ItemBaseConfData> ___itemBaseList, ref List <EquipmentItemConfData> ___equipmentDataList)
            {
                if (!enabled)
                {
                    return;
                }
                int itemIds   = 42000000;
                int nameIds   = 42000000;
                int sourceIds = 4200;

                foreach (NewItem item in newItems)
                {
                    nameDesc.Add(nameIds, item.name);
                    nameDesc.Add(nameIds + 1, item.description);
                    nameDesc.Add(nameIds + 2, item.effect);
                    nameDesc.Add(nameIds + 3, storeNames[item.storeId]);
                    sourceStrings.Add(sourceIds, nameIds + 3);

                    ItemBaseConfData itemConf = new ItemBaseConfData()
                    {
                        ID               = itemIds,
                        NameID           = nameIds,
                        Explain_one      = nameIds + 1,
                        BuyPrice         = item.buyPrice,
                        SellPrice        = item.sellPrice,
                        ExhibitModelPath = item.dropModelPath,
                        giftModelPath    = item.dropModelPath,
                        displayScale     = item.displayScale,
                        ItemType         = new ItemType[] { ItemType.Equipment },

                        sourceIndex = new int[] { sourceIds },
                        orderIndex  = item.orderIndex,

                        ItemFunctionID     = itemIds,
                        StackLimitedNumber = 1,
                        isGift             = 0,
                        rareLv             = 0,
                        reputationModify   = 0,

                        intendType      = item.intendType,
                        skillIds        = item.skillIds,
                        alwaysOnHand    = item.alwaysOnHand,
                        holdInBothHands = item.holdInBothHands,
                        energy          = -1,
                        hotValue        = 0,
                        recycleTag      = "1",
                        Effect_Desc_ID  = nameIds + 2,
                        HaveIcon        = true,
                        CanPickup       = true,
                        CanDiscard      = true,
                        CanSell         = true,
                    };

                    typeof(ItemBaseConfData).GetField("iconPath", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(itemConf, item.iconPath);
                    typeof(ItemBaseConfData).GetField("ModelPath", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(itemConf, item.modelPath);
                    typeof(ItemBaseConfData).GetField("DropModelPathMale", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(itemConf, item.dropModelPath);

                    ___itemBaseList.Add(itemConf);

                    EquipmentItemConfData equipConf = new EquipmentItemConfData()
                    {
                        id                  = itemIds,
                        equipType           = 0,
                        durabilityMax       = 100,
                        durabilityCost      = 0,
                        repairRate          = 1,
                        attack              = item.attack,
                        defense             = item.defense,
                        critical            = item.critical,
                        antiCritical        = item.antiCritical,
                        hpMax               = item.hpMax,
                        cpMax               = item.cpMax,
                        attackType          = AttackType.Melee,
                        digGridCount        = item.digGridCount,
                        digIntensity        = item.digIntensity,
                        Rate                = item.rate,
                        dateForce           = 0,
                        meleeCriticalAmount = item.meleeCriticalAmount,
                        rangeCriticalAmount = 0,
                    };

                    ___equipmentDataList.Add(equipConf);

                    storeItems.Add(new StoreItem(itemIds, productIds++, 1, -1, "-1", "-1", item.storeId, item.chance));

                    itemIds++;
                    nameIds += 4;
                    sourceIds++;
                }
            }