Пример #1
0
        public static void CreatePropertySeries(Level lvl, Tendency tend, string name, string formatA,
            int object1a, int value1a, int type1a, int step1a,
            int object2a = 0, int value2a = 0, int type2a = 0, int step2a = 0,
            int object3a = 0, int value3a = 0, int type3a = 0, int step3a = 0,
            string formatB = "",
            int object1b = 0, int value1b = 0, int type1b = 0, int step1b = 0,
            int object2b = 0, int value2b = 0, int type2b = 0, int step2b = 0,
            int object3b = 0, int value3b = 0, int type3b = 0, int step3b = 0,
            string formatC = "",
            int object1c = 0, int value1c = 0, int type1c = 0, int step1c = 0,
            int object2c = 0, int value2c = 0, int type2c = 0, int step2c = 0,
            int object3c = 0, int value3c = 0, int type3c = 0, int step3c = 0)
        {
            int pMax = (from d in LegacyToolBox.Data.ItemRandomProperty select d.ID).Max() + 1;
            int eMax = (from d in LegacyToolBox.Data.SpellItemEnchant select d.ID).Max() + 1;

            int level = (int)lvl;
            int tendency = (int)tend;

            item_suffix suffix = new item_suffix();
            suffix.Suffix = pMax;

            int p = 0;
            ItemRandomProperty property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank1 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank2 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank3 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank4 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank5 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank6 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank7 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank8 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank9 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank10 = property.ID;
            DB.LEGACY.item_suffix.Add(suffix);
            DB.LSave();
        }
Пример #2
0
        public static void CreateSuffixSeries(Level lvl, string name, Tendency tend, Enchant ench1, int factorStart1, int factorEnd1,
            Enchant ench2 = 0, int factorStart2 = 0, int factorEnd2 = 0,
            Enchant ench3 = 0, int factorStart3 = 0, int factorEnd3 = 0)
        {
            int progression1 = (factorEnd1 - factorStart1) / 10;
            int progression2 = (factorEnd2 - factorStart2) / 10;
            int progression3 = (factorEnd3 - factorStart3) / 10;

            int enchant1 = (int)ench1;
            int enchant2 = (int)ench2;
            int enchant3 = (int)ench3;

            int level = (int)lvl;
            int tendency = (int)tend;

            LegacyToolBox.AppendMessage(string.Format("creating suffix {0}+{1}+{2} of level {3} tendency {4}", enchant1, enchant2, enchant3, level, tendency));

            int maxid = (from d in LegacyToolBox.Data.ItemRandomSuffix select d.ID).Max() + 1;

            item_suffix suffixDb = new item_suffix();
            suffixDb.Level = level;
            suffixDb.Suffix = -maxid;
            suffixDb.Tendency = tendency;

            int p = 0;
            ItemRandomSuffix suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank1 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank2 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank3 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank4 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank5 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank6 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank7 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank8 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank9 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank10 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            DB.LEGACY.item_suffix.Add(suffixDb);
            DB.LSave();
        }