Exemplo n.º 1
0
        private void Fill(int level)
        {
            TrapType  = TrapType.ExplosionTrap;
            TrapPower = level * 25;
            TrapLevel = level;
            Locked    = true;

            switch (level)
            {
            case 1:
                RequiredSkill = 36;
                break;

            case 2:
                RequiredSkill = 76;
                break;

            case 3:
                RequiredSkill = 84;
                break;

            case 4:
                RequiredSkill = 92;
                break;

            case 5:
                RequiredSkill = 100;
                break;

            case 6:
                RequiredSkill = 100;
                break;
            }

            LockLevel    = RequiredSkill - 10;
            MaxLockLevel = RequiredSkill + 40;

            DropItem(new Gold(level * 200));

            for (int i = 0; i < level; ++i)
            {
                DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
            }

            for (int i = 0; i < level * 2; ++i)
            {
                Item item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if (item != null)
                {
                    TreasureMapChest.GetRandomItemStat(out int min, out int max);

                    RunicReforging.GenerateRandomItem(item, 0, min, max);

                    DropItem(item);
                }
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomPossibleReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                DropItem(item);
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomGem();
                DropItem(item);
            }

            DropItem(new TreasureMap(TreasureMapInfo.ConvertLevel(level + 1), (Siege.SiegeShard ? Map.Felucca : Utility.RandomBool() ? Map.Felucca : Map.Trammel)));
        }
Exemplo n.º 2
0
        private void Fill(int level)
        {
            TrapType  = TrapType.ExplosionTrap;
            TrapPower = level * 25;
            TrapLevel = level;
            Locked    = true;

            switch (level)
            {
            case 1:
                RequiredSkill = 36;
                break;

            case 2:
                RequiredSkill = 76;
                break;

            case 3:
                RequiredSkill = 84;
                break;

            case 4:
                RequiredSkill = 92;
                break;

            case 5:
                RequiredSkill = 100;
                break;

            case 6:
                RequiredSkill = 100;
                break;
            }

            LockLevel    = RequiredSkill - 10;
            MaxLockLevel = RequiredSkill + 40;

            DropItem(new Gold(level * 200));

            for (int i = 0; i < level; ++i)
            {
                DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
            }

            for (int i = 0; i < level * 2; ++i)
            {
                Item item;

                if (Core.AOS)
                {
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
                }
                else
                {
                    item = Loot.RandomArmorOrShieldOrWeapon();
                }

                if (item != null && Core.HS && RandomItemGenerator.Enabled)
                {
                    TreasureMapChest.GetRandomItemStat(out int min, out int max);
                    RunicReforging.GenerateRandomItem(item, 0, min, max);
                    DropItem(item);
                    continue;
                }

                if (item is BaseWeapon weapon)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out int attributeCount, out int min, out int max);
                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                    }
                    else
                    {
                        weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(item);
                }
                else if (item is BaseArmor armor)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out int attributeCount, out int min, out int max);
                        BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                    }
                    else
                    {
                        armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(item);
                }
                else if (item is BaseHat hat)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out int attributeCount, out int min, out int max);
                        BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                    }
                    DropItem(item);
                }
                else if (item is BaseJewel)
                {
                    GetRandomAOSStats(out int attributeCount, out int min, out int max);
                    BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);
                    DropItem(item);
                }
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomPossibleReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                DropItem(item);
            }

            for (int i = 0; i < level; i++)
            {
                Item item = Loot.RandomGem();
                DropItem(item);
            }

            DropItem(new TreasureMap(TreasureMapInfo.ConvertLevel(level + 1), (Siege.SiegeShard ? Map.Felucca : Utility.RandomBool() ? Map.Felucca : Map.Trammel)));
        }