Esempio n. 1
0
        public UpgradeRow Clone()
        {
            UpgradeRow r = (UpgradeRow)this.MemberwiseClone();

            r.reqItems = new List <int>(reqItems);
            return(r);
        }
Esempio n. 2
0
        private void setGenerics()
        {
            CURRENT_WEAPON_INDEX    = WEAPON_INDEX;
            CURRENT_ARMOR_INDEX     = ARMOR_INDEX;
            CURRENT_HIGHARMOR_INDEX = HIGH_ARMOR_INDEX;
            CURRENT_ACCESSORY_INDEX = ACCESSORY_INDEX;

            upgradeRows.Clear();

            foreach (UpgradeScroll s in _scrolls.Values)
            {
                if (s.Type == UpgradeScroll.UpgradeType.REGULAR || s.Type == UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND || s.Type == UpgradeScroll.UpgradeType.ACCESSORYENCHANT)
                {
                    for (int i = 1; i < 11; i++)
                    {
                        setGenericItemUpgrades(s, i);
                    }
                }
                else
                {
                    for (int i = 1; i < 11; i++)
                    {
                        Rate       sr = s.Rates[i];
                        UpgradeRow r  = new UpgradeRow();
                        if (s.Weapon)
                        {
                            r = new UpgradeRow(CURRENT_WEAPON_INDEX++, s.Modifier, "Generic Weapon Alteration", sr.Cost);
                        }
                        else if (s.Armor)
                        {
                            r = new UpgradeRow(CURRENT_ARMOR_INDEX++, s.Modifier, "Generic Armor Alteration", sr.Cost);
                        }

                        r.RequiredItems[0] = s.ID;
                        r.Item             = i;
                        r.Percent          = sr.Percent;
                        upgradeRows.Add(r.Index, r);
                    }
                }
            }
        }
Esempio n. 3
0
        private void addUniqueUpgrade(Item i)
        {
            int id = getUnlockedID(i);

            if (id == -1)
                return;
            //Check if is accessory

            foreach (UpgradeScroll us in _scrolls.Values)
            {
                UpgradeRow r;
                Rate sr = us.Rates[0];
                if (us.Type == UpgradeScroll.UpgradeType.ELEMENT || us.Type == UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND)
                {
                    if (i.isAccessory)
                        r = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, (id - i.ID), "Unique Accessory Elemental Unlock", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);
                    else
                        r = new UpgradeRow(CURRENT_WEAPON_INDEX++, (id - i.ID), "Unique Weapon Elemental Unlock", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);

                    r.RequiredItems[0] = us.ID;
                    r.Item = i.ExtensionID;
                    r.Percent = us.Rates[0].Percent;
                    upgradeRows.Add(r.Index, r);
                }

                if (us.Type == UpgradeScroll.UpgradeType.REGULAR || us.Type == UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND)
                {
                    for (int c = 1; c < 11; c++)
                    {
                        sr = us.Rates[c];
                        if(i.isAccessory && us.Accessory)
                            r = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, us.Modifier, "Unique Accessory Upgrade (" + i.Name.Replace("'", "''") + ")", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);
                        else
                            r = new UpgradeRow(CURRENT_WEAPON_INDEX++, us.Modifier, "Unique Weapon Upgrade (" + i.Name.Replace("'", "''") + ")", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);
                        r.RequiredItems[0] = us.ID;

                        r.Item = (_items[id].ExtensionID+(c-1));
                        r.Percent = us.Rates[c].Percent;
                        upgradeRows.Add(r.Index, r);

                        if (us.Grade == UpgradeScroll.GradeLevel.BLESSED)
                        {
                            r = r.Clone();
                            if (i.isAccessory)
                                r.Index = CURRENT_ACCESSORY_INDEX++;
                            else
                                r.Index = CURRENT_WEAPON_INDEX++;

                            r.Item = (_items[id].ExtensionID + (c - 1));
                            r.RequiredItems[0] = TRINA_ID;
                            r.RequiredItems[1] = us.ID;
                            r.Percent = us.Rates[c].TrinaPercent;
                            upgradeRows.Add(r.Index, r);
                        }

                    }
                }

            }
        }
Esempio n. 4
0
        private void setGenerics()
        {
            CURRENT_WEAPON_INDEX = WEAPON_INDEX;
            CURRENT_ARMOR_INDEX = ARMOR_INDEX;
            CURRENT_HIGHARMOR_INDEX = HIGH_ARMOR_INDEX;
            CURRENT_ACCESSORY_INDEX = ACCESSORY_INDEX;

            upgradeRows.Clear();

            foreach(UpgradeScroll s in _scrolls.Values)
            {

                if (s.Type == UpgradeScroll.UpgradeType.REGULAR || s.Type == UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND || s.Type == UpgradeScroll.UpgradeType.ACCESSORYENCHANT)
                {
                    for (int i = 1; i < 11; i++)
                        setGenericItemUpgrades(s, i);
                }
                else
                {

                    for (int i = 1; i < 11; i++)
                    {

                        Rate sr = s.Rates[i];
                        UpgradeRow r = new UpgradeRow();
                        if (s.Weapon)
                            r = new UpgradeRow(CURRENT_WEAPON_INDEX++, s.Modifier, "Generic Weapon Alteration", sr.Cost);
                        else if (s.Armor)
                            r = new UpgradeRow(CURRENT_ARMOR_INDEX++, s.Modifier, "Generic Armor Alteration", sr.Cost);

                        r.RequiredItems[0] = s.ID;
                        r.Item = i;
                        r.Percent = sr.Percent;
                        upgradeRows.Add(r.Index, r);
                    }
                }

            }
        }
Esempio n. 5
0
        private void setGenericItemUpgrades(UpgradeScroll s, int i)
        {
            for (int c = s.Grade == UpgradeScroll.GradeLevel.BLESSED ? 0 : 1; c < 2; c++)
            {
                Rate sr = s.Rates[i];
                UpgradeRow r;
                switch (s.Type)
                {
                    case UpgradeScroll.UpgradeType.REGULAR:
                        #region Generic Item Upgrades

                        string[] weaponUpgradeNames = { "", "Reduce", "Poison" };
                        int[] weaponUpgradeIDs = { 0, 30, 40 };
                        for (int n = 0; n < weaponUpgradeNames.Length; n++)
                        {
                            r = new UpgradeRow(CURRENT_WEAPON_INDEX++, s.Modifier, "Generic Weapon Upgrade" + (weaponUpgradeNames[n].Length > 0 ? " (" + weaponUpgradeNames[n] + ")" : ""), sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                            if (c == 0)
                            {
                                r.RequiredItems[0] = TRINA_ID;
                                r.RequiredItems[1] = s.ID;
                            }
                            else
                                r.RequiredItems[0] = s.ID;

                            r.Item = weaponUpgradeIDs[n] + sr.Grade;
                            r.Percent = c == 0 ? sr.TrinaPercent : sr.Percent;
                            upgradeRows.Add(r.Index, r);
                        }

                        string[] armorUpgradeNames = { "", "Strength", "Intelligence", "Magic Power", "Health", "Dexterity", "Intelligence", "Magic Power" };
                        int[] armorUpgradeIDs = { 0, 10, 20, 30, 500, 510, 520, 530 };

                        for (int n = 0; n < armorUpgradeNames.Length; n++)
                        {
                            r = new UpgradeRow(CURRENT_ARMOR_INDEX++, s.Modifier, "Generic Armor Upgrade" + (armorUpgradeNames[n].Length > 0 ? " (" + armorUpgradeNames[n] + ")" : ""), sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                            if (c == 0)
                            {
                                r.RequiredItems[0] = TRINA_ID;
                                r.RequiredItems[1] = s.ID;
                            }
                            else
                                r.RequiredItems[0] = s.ID;
                            r.Item = i + armorUpgradeIDs[n];
                            r.Percent = c == 0 ? sr.TrinaPercent : sr.Percent;
                            upgradeRows.Add(r.Index, r);
                            r = r.Clone();
                            r.Index = CURRENT_HIGHARMOR_INDEX++;
                            upgradeRows.Add(r.Index, r);
                        }
                        #endregion
                        break;
                    case UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND:
                        #region Generic Accessories
                        int[] arr = { 0, 10, 20, 30, 70 };
                        int[] arr2 = { 500, 510, 520, 530, 550, 560, 570, 580, 600, 610, 620, 630, 650, 660, 670, 680, 700, 710, 720, 730 };
                        for (int n = 0; n < arr.Length; n++)
                        {
                            r = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, s.Modifier, "Generic Accessory Upgrade", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                            r.Item = i + arr[n];
                            r.Percent = sr.Percent;
                            r.RequiredItems[0] = s.ID;
                            upgradeRows.Add(r.Index, r);
                        }

                        sr = s.Rates[i + 10];

                        for (int n = 0; n < arr2.Length; n++)
                        {
                            r = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, s.Modifier, "Generic Accessory Upgrade", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                            r.Item = i + arr2[n];
                            r.Percent = sr.Percent;
                            r.RequiredItems[0] = s.ID;
                            upgradeRows.Add(r.Index, r);
                        }
                        #endregion
                        break;
                    case UpgradeScroll.UpgradeType.ACCESSORYENCHANT:
                    #region Accessory Enchants
                    Dictionary<int, int> items = new Dictionary<int, int>();
                    switch (s.ID)
                    {
                        case 379160000:
                            items.Add(20, 531);
                            items.Add(30, 571);
                            items.Add(40, 611);
                            items.Add(80, 621);
                            break;
                        case 379161000:
                            items.Add(10, 491);
                            items.Add(30, 581);
                            items.Add(40, 621);
                            items.Add(80, 631);
                            break;
                        case 379162000:
                            items.Add(10, 491);
                            items.Add(30, 581);
                            items.Add(40, 621);
                            items.Add(80, 631);
                            break;
                        case 379163000:
                            items.Add(10, 491);
                            items.Add(30, 581);
                            items.Add(40, 621);
                            items.Add(80, 631);
                            break;
                        case 379164000:
                            items.Add(10, 521);
                            items.Add(20, 561);
                            items.Add(30, 601);
                            items.Add(40, 641);
                            break;
                    }
                    foreach (KeyValuePair<int, int> kvp in items)
                    {
                        r = new UpgradeRow() { Index = CURRENT_ACCESSORY_INDEX++, Item = kvp.Key, Percent = sr.Percent, Modifier = kvp.Value, Name = "Generic Accessory Upgrade", Note = "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", Cost = sr.Cost, Extension = -1 };
                        r.RequiredItems[0] = s.ID;
                        upgradeRows.Add(r.Index, r);
                    }
                    #endregion
                        break;
                }
            }
        }
Esempio n. 6
0
        private void setGenericItemUpgrades(UpgradeScroll s, int i)
        {
            for (int c = s.Grade == UpgradeScroll.GradeLevel.BLESSED ? 0 : 1; c < 2; c++)
            {
                Rate       sr = s.Rates[i];
                UpgradeRow r;
                switch (s.Type)
                {
                case UpgradeScroll.UpgradeType.REGULAR:
                    #region Generic Item Upgrades

                    string[] weaponUpgradeNames = { "", "Reduce", "Poison" };
                    int[]    weaponUpgradeIDs   = { 0, 30, 40 };
                    for (int n = 0; n < weaponUpgradeNames.Length; n++)
                    {
                        r = new UpgradeRow(CURRENT_WEAPON_INDEX++, s.Modifier, "Generic Weapon Upgrade" + (weaponUpgradeNames[n].Length > 0 ? " (" + weaponUpgradeNames[n] + ")" : ""), sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                        if (c == 0)
                        {
                            r.RequiredItems[0] = TRINA_ID;
                            r.RequiredItems[1] = s.ID;
                        }
                        else
                        {
                            r.RequiredItems[0] = s.ID;
                        }

                        r.Item    = weaponUpgradeIDs[n] + sr.Grade;
                        r.Percent = c == 0 ? sr.TrinaPercent : sr.Percent;
                        upgradeRows.Add(r.Index, r);
                    }

                    string[] armorUpgradeNames = { "", "Strength", "Intelligence", "Magic Power", "Health", "Dexterity", "Intelligence", "Magic Power" };
                    int[]    armorUpgradeIDs   = { 0, 10, 20, 30, 500, 510, 520, 530 };

                    for (int n = 0; n < armorUpgradeNames.Length; n++)
                    {
                        r = new UpgradeRow(CURRENT_ARMOR_INDEX++, s.Modifier, "Generic Armor Upgrade" + (armorUpgradeNames[n].Length > 0 ? " (" + armorUpgradeNames[n] + ")" : ""), sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                        if (c == 0)
                        {
                            r.RequiredItems[0] = TRINA_ID;
                            r.RequiredItems[1] = s.ID;
                        }
                        else
                        {
                            r.RequiredItems[0] = s.ID;
                        }
                        r.Item    = i + armorUpgradeIDs[n];
                        r.Percent = c == 0 ? sr.TrinaPercent : sr.Percent;
                        upgradeRows.Add(r.Index, r);
                        r       = r.Clone();
                        r.Index = CURRENT_HIGHARMOR_INDEX++;
                        upgradeRows.Add(r.Index, r);
                    }
                    #endregion
                    break;

                case UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND:
                    #region Generic Accessories
                    int[] arr  = { 0, 10, 20, 30, 70 };
                    int[] arr2 = { 500, 510, 520, 530, 550, 560, 570, 580, 600, 610, 620, 630, 650, 660, 670, 680, 700, 710, 720, 730 };
                    for (int n = 0; n < arr.Length; n++)
                    {
                        r                  = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, s.Modifier, "Generic Accessory Upgrade", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                        r.Item             = i + arr[n];
                        r.Percent          = sr.Percent;
                        r.RequiredItems[0] = s.ID;
                        upgradeRows.Add(r.Index, r);
                    }

                    sr = s.Rates[i + 10];

                    for (int n = 0; n < arr2.Length; n++)
                    {
                        r                  = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, s.Modifier, "Generic Accessory Upgrade", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")");
                        r.Item             = i + arr2[n];
                        r.Percent          = sr.Percent;
                        r.RequiredItems[0] = s.ID;
                        upgradeRows.Add(r.Index, r);
                    }
                    #endregion
                    break;

                case UpgradeScroll.UpgradeType.ACCESSORYENCHANT:
                    #region Accessory Enchants
                    Dictionary <int, int> items = new Dictionary <int, int>();
                    switch (s.ID)
                    {
                    case 379160000:
                        items.Add(20, 531);
                        items.Add(30, 571);
                        items.Add(40, 611);
                        items.Add(80, 621);
                        break;

                    case 379161000:
                        items.Add(10, 491);
                        items.Add(30, 581);
                        items.Add(40, 621);
                        items.Add(80, 631);
                        break;

                    case 379162000:
                        items.Add(10, 491);
                        items.Add(30, 581);
                        items.Add(40, 621);
                        items.Add(80, 631);
                        break;

                    case 379163000:
                        items.Add(10, 491);
                        items.Add(30, 581);
                        items.Add(40, 621);
                        items.Add(80, 631);
                        break;

                    case 379164000:
                        items.Add(10, 521);
                        items.Add(20, 561);
                        items.Add(30, 601);
                        items.Add(40, 641);
                        break;
                    }
                    foreach (KeyValuePair <int, int> kvp in items)
                    {
                        r = new UpgradeRow()
                        {
                            Index = CURRENT_ACCESSORY_INDEX++, Item = kvp.Key, Percent = sr.Percent, Modifier = kvp.Value, Name = "Generic Accessory Upgrade", Note = "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", Cost = sr.Cost, Extension = -1
                        };
                        r.RequiredItems[0] = s.ID;
                        upgradeRows.Add(r.Index, r);
                    }
                    #endregion
                    break;
                }
            }
        }
Esempio n. 7
0
        private void addUniqueUpgrade(Item i)
        {
            int id = getUnlockedID(i);

            if (id == -1)
            {
                return;
            }
            //Check if is accessory

            foreach (UpgradeScroll us in _scrolls.Values)
            {
                UpgradeRow r;
                Rate       sr = us.Rates[0];
                if (us.Type == UpgradeScroll.UpgradeType.ELEMENT || us.Type == UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND)
                {
                    if (i.isAccessory)
                    {
                        r = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, (id - i.ID), "Unique Accessory Elemental Unlock", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);
                    }
                    else
                    {
                        r = new UpgradeRow(CURRENT_WEAPON_INDEX++, (id - i.ID), "Unique Weapon Elemental Unlock", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);
                    }

                    r.RequiredItems[0] = us.ID;
                    r.Item             = i.ExtensionID;
                    r.Percent          = us.Rates[0].Percent;
                    upgradeRows.Add(r.Index, r);
                }

                if (us.Type == UpgradeScroll.UpgradeType.REGULAR || us.Type == UpgradeScroll.UpgradeType.ACCESSORYCOMPOUND)
                {
                    for (int c = 1; c < 11; c++)
                    {
                        sr = us.Rates[c];
                        if (i.isAccessory && us.Accessory)
                        {
                            r = new UpgradeRow(CURRENT_ACCESSORY_INDEX++, us.Modifier, "Unique Accessory Upgrade (" + i.Name.Replace("'", "''") + ")", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);
                        }
                        else
                        {
                            r = new UpgradeRow(CURRENT_WEAPON_INDEX++, us.Modifier, "Unique Weapon Upgrade (" + i.Name.Replace("'", "''") + ")", sr.Cost, "(+" + sr.Grade + " -> +" + (sr.Grade + 1) + ")", i.Extension);
                        }
                        r.RequiredItems[0] = us.ID;

                        r.Item    = (_items[id].ExtensionID + (c - 1));
                        r.Percent = us.Rates[c].Percent;
                        upgradeRows.Add(r.Index, r);

                        if (us.Grade == UpgradeScroll.GradeLevel.BLESSED)
                        {
                            r = r.Clone();
                            if (i.isAccessory)
                            {
                                r.Index = CURRENT_ACCESSORY_INDEX++;
                            }
                            else
                            {
                                r.Index = CURRENT_WEAPON_INDEX++;
                            }

                            r.Item             = (_items[id].ExtensionID + (c - 1));
                            r.RequiredItems[0] = TRINA_ID;
                            r.RequiredItems[1] = us.ID;
                            r.Percent          = us.Rates[c].TrinaPercent;
                            upgradeRows.Add(r.Index, r);
                        }
                    }
                }
            }
        }