예제 #1
0
        public static void ApplyAttributesTo(BaseHat hat, bool isRunicTool, int luckChance, int attributeCount, int min, int max)
        {
            m_IsRunicTool = isRunicTool;
            m_LuckChance  = luckChance;

            AosAttributes        primary   = hat.Attributes;
            AosArmorAttributes   secondary = hat.ClothingAttributes;
            AosElementAttributes resists   = hat.Resistances;

            m_Props.SetAll(false);

            for (int i = 0; i < attributeCount; ++i)
            {
                int random = GetUniqueRandom(19);

                if (random == -1)
                {
                    break;
                }

                switch (random)
                {
                case  0: ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15); break;

                case  1: ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2); break;

                case  2: ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3); break;

                case  3: ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2); break;

                case  4: ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1); break;

                case  5: ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 5); break;

                case  6: ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8); break;

                case  7: ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8); break;

                case  8: ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8); break;

                case  9: ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20); break;

                case 10: ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100); break;

                case 11: ApplyAttribute(secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10); break;

                case 12: ApplyAttribute(secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5); break;

                case 13: ApplyAttribute(secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10); break;

                case 14: ApplyAttribute(resists, min, max, AosElementAttribute.Physical, 1, 15); break;

                case 15: ApplyAttribute(resists, min, max, AosElementAttribute.Fire, 1, 15); break;

                case 16: ApplyAttribute(resists, min, max, AosElementAttribute.Cold, 1, 15); break;

                case 17: ApplyAttribute(resists, min, max, AosElementAttribute.Poison, 1, 15); break;

                case 18: ApplyAttribute(resists, min, max, AosElementAttribute.Energy, 1, 15); break;
                }
            }
        }
예제 #2
0
 public static void ApplyAttributesTo(BaseHat hat, int attributeCount, int min, int max)
 {
     ApplyAttributesTo(hat, false, 0, attributeCount, min, max);
 }
예제 #3
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;
            int numberItems;

            if (level == 0)
            {
                cont.LockLevel = 0; // Can't be unlocked

                cont.DropItem(new Gold(Utility.RandomMinMax(50, 100)));

                if (Utility.RandomDouble() < 0.75)
                {
                    cont.DropItem(new TreasureMap(0, Map.Trammel));
                }
            }
            else
            {
                cont.TrapType  = TrapType.ExplosionTrap;
                cont.TrapPower = level * 25;
                cont.TrapLevel = level;

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

                case 2: cont.RequiredSkill = 76; break;

                case 3: cont.RequiredSkill = 84; break;

                case 4: cont.RequiredSkill = 92; break;

                case 5: cont.RequiredSkill = 100; break;

                case 6: cont.RequiredSkill = 100; break;
                }

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

                //Publish 67 gold change
                //if ( Core.SA )
                //	cont.DropItem( new Gold( level * 5000 ) );
                //else
                cont.DropItem(new Gold(level * 1000));

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

                if (Core.SE)
                {
                    switch (level)
                    {
                    case 1: numberItems = 5; break;

                    case 2: numberItems = 10; break;

                    case 3: numberItems = 15; break;

                    case 4: numberItems = 38; break;

                    case 5: numberItems = 50; break;

                    case 6: numberItems = 60; break;

                    default: numberItems = 0; break;
                    }
                    ;
                }
                else
                {
                    numberItems = level * 6;
                }

                for (int i = 0; i < numberItems; ++i)
                {
                    Item item;

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

                    if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out 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);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                        }
                        else
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                            armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseHat)
                    {
                        BaseHat hat = (BaseHat)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseJewel)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                }
            }

            int reagents;

            if (level == 0)
            {
                reagents = 12;
            }
            else
            {
                reagents = level * 3;
            }

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

            int gems;

            if (level == 0)
            {
                gems = 2;
            }
            else
            {
                gems = level * 3;
            }

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

            if (level == 6 && Core.AOS)
            {
                cont.DropItem((Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]));
            }
        }
예제 #4
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;
            }

            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 is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out 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)
                {
                    BaseArmor armor = (BaseArmor)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out 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)
                {
                    BaseHat hat = (BaseHat)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                    }

                    DropItem(item);
                }
                else if (item is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out 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(level + 1, (Utility.RandomBool() ? Map.Felucca : Map.Trammel)));
        }
예제 #5
0
        protected override void GenerateTreasure()
        {
            DropItem(new Gold(600, 900));

            List <Item> gems = new List <Item>();

            for (int i = 0; i < 9; i++)
            {
                Item gem     = Loot.RandomGem();
                Type gemType = gem.GetType();

                foreach (Item listGem in gems)
                {
                    if (listGem.GetType() == gemType)
                    {
                        listGem.Amount++;
                        gem.Delete();
                        break;
                    }
                }

                if (!gem.Deleted)
                {
                    gems.Add(gem);
                }
            }

            foreach (Item gem in gems)
            {
                DropItem(gem);
            }

            if (0.2 > Utility.RandomDouble())
            {
                DropItem(new BagOfReagents(50));
            }

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

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

                if (item is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out 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)
                {
                    BaseArmor armor = (BaseArmor)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out 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)
                {
                    BaseHat hat = (BaseHat)item;

                    if (Core.AOS)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                    }

                    DropItem(item);
                }
                else if (item is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);

                    DropItem(item);
                }
            }

            Solution = new PuzzleChestSolution();
        }