ApplyAttributesTo() public static méthode

public static ApplyAttributesTo ( BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount ) : void
armor BaseArmor
isRunicTool bool
luckChance int
attributeCount int
Résultat void
        public TurqouiseRing() : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(1, 3), 0, 100);

            if (Utility.Random(100) < 10)
            {
                Attributes.WeaponSpeed += 5;
            }
            else
            {
                Attributes.WeaponDamage += 15;
            }
        }
Exemple #2
0
        public DarkSapphireBracelet() : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(1, 4), 0, 100);

            if (Utility.Random(100) < 10)
            {
                Attributes.RegenMana += 2;
            }
            else
            {
                Resistances.Cold += 10;
            }
        }
Exemple #3
0
        public EcruCitrineRing() : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(2, 3), 0, 100);

            if (Utility.RandomBool())
            {
                Attributes.EnhancePotions = 75;
            }
            else
            {
                Attributes.BonusStr += 5;
            }
        }
        public PerfectEmeraldRing() : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(2, 4), 0, 100);

            if (Utility.RandomBool())
            {
                Resistances.Poison += 10;
            }
            else
            {
                Attributes.SpellDamage += 5;
            }
        }
		public PerfectEmeraldRing()
		{
			Weight = 1.0;
			BaseRunicTool.ApplyAttributesTo( this, Utility.RandomMinMax( 1, 4 ), 1, 80 );
			Resistances.Poison = 0;
			Attributes.LowerManaCost = 0;

			if ( Utility.Random( 100 ) < 10 )
			{
				Attributes.LowerManaCost += 5;
			}
			else
			{
				Resistances.Poison += 10;
			}
		}
Exemple #6
0
        public FireRubyBracelet()
            : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, true, 0, Utility.RandomMinMax(1, 4), 0, 100);

            if (Utility.Random(100) < 10)
            {
                Attributes.RegenHits += 2;
            }
            else
            {
                Resistances.Fire += 10;
            }
        }
        public BlueDiamondRing() : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(2, 4), 0, 100);

            switch (Utility.Random(4))
            {
            case 0: Attributes.LowerManaCost += 10; break;

            case 1: Attributes.CastSpeed += 1; break;

            case 2: Attributes.CastRecovery += 2; break;

            case 3: Attributes.SpellDamage += 5; break;
            }
        }
        public BrilliantAmberBracelet() : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(1, 4), 0, 100);

            switch (Utility.Random(4))
            {
            case 0: Attributes.LowerRegCost += 10; break;

            case 1: Attributes.CastSpeed += 1; break;

            case 2: Attributes.CastRecovery += 2; break;

            case 3: Attributes.SpellDamage += 5; break;
            }
        }
Exemple #9
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            int magery = from.Skills.Magery.BaseFixedPoint;

            if (magery >= 800)
            {
                int[] propertyCounts;

                if (magery >= 1000)
                {
                    if (magery >= 1200)
                    {
                        propertyCounts = m_LegendPropertyCounts;
                    }
                    else if (magery >= 1100)
                    {
                        propertyCounts = m_ElderPropertyCounts;
                    }
                    else
                    {
                        propertyCounts = m_GrandPropertyCounts;
                    }
                }
                else if (magery >= 900)
                {
                    propertyCounts = m_MasterPropertyCounts;
                }
                else
                {
                    propertyCounts = m_AdeptPropertyCounts;
                }

                int propertyCount = propertyCounts[Utility.Random(propertyCounts.Length)];

                BaseRunicTool.ApplyAttributesTo(this, true, 0, propertyCount);
            }

            if (makersMark)
            {
                Crafter = from;
            }

            m_Quality = (BookQuality)(quality - 1);

            return(quality);
        }
        public ChestOfHeirlooms()
            : base(0x2811)
        {
            Locked        = true;
            LockLevel     = 95;
            MaxLockLevel  = 140;
            RequiredSkill = 95;

            TrapType  = TrapType.ExplosionTrap;
            TrapLevel = 10;
            TrapPower = 100;

            GumpID = 0x10B;

            for (int i = 0; i < 10; ++i)
            {
                Item item = Loot.ChestOfHeirloomsContains();

                int attributeCount = Utility.RandomMinMax(1, 5);
                int min            = 20;
                int max            = 80;

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

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (item is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)item;

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (item is BaseHat)
                {
                    BaseRunicTool.ApplyAttributesTo((BaseHat)item, attributeCount, min, max);
                }
                else if (item is BaseJewel)
                {
                    BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);
                }

                DropItem(item);
            }
        }
Exemple #11
0
        public FireRubyBracelet()
        {
            Weight = 1.0;
            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(0, 4), 1, 80);

            if (Utility.Random(100) < 10)
            {
                Attributes.RegenHits += 2;
            }
            else
            {
                Resistances.Fire += 10;
                if (Resistances.Fire > 15)
                {
                    Resistances.Fire = 15;
                }
            }
        }
        public void Fill()
        {
            Item item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

            if (item is BaseArmor)
            {
                BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 1, 10, 30);
            }
            else if (item is BaseWeapon)
            {
                BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, 1, 10, 30);
            }
            else if (item is BaseJewel)
            {
                BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 1, 10, 30);
            }

            DropItem(item);
        }
        public WhitePearlBracelet() : base()
        {
            Weight = 1.0;

            Attributes.NightSight = 1;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(3, 5), 0, 100);

            if (Utility.Random(100) < 50)
            {
                switch (Utility.Random(3))
                {
                case 0: Attributes.CastSpeed += 1; break;

                case 1: Attributes.CastRecovery += 2; break;

                case 2: Attributes.LowerRegCost += 10; break;
                }
            }
        }
        public BrilliantAmberBracelet()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(0, 4), 1, 100);

            switch (Utility.Random(4))
            {
            case 0:
                Attributes.LowerRegCost += 10;
                if (Attributes.LowerRegCost > 20)
                {
                    Attributes.LowerRegCost = 20;
                }
                break;

            case 1:
                Attributes.CastSpeed += 1;
                if (Attributes.CastSpeed > 1)
                {
                    Attributes.CastSpeed = 1;
                }
                break;

            case 2:
                Attributes.CastRecovery += 2;
                if (Attributes.CastRecovery > 3)
                {
                    Attributes.CastRecovery = 3;
                }
                break;

            case 3:
                Attributes.SpellDamage += 5;
                if (Attributes.SpellDamage > 12)
                {
                    Attributes.SpellDamage = 12;
                }
                break;
            }
        }
Exemple #15
0
        public void Fill()
        {
            Map map = this.Map;

            Item item = (map == Map.Tokuno) ? Loot.RandomSEArmorOrShieldOrWeaponOrJewelry() : Loot.RandomArmorOrShieldOrWeaponOrJewelry();

            if (item is BaseArmor)
            {
                BaseRunicTool.ApplyAttributesTo((BaseArmor)item, 1, 10, 30);
            }
            else if (item is BaseWeapon)
            {
                BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, 1, 10, 30);
            }
            else if (item is BaseJewel)
            {
                BaseRunicTool.ApplyAttributesTo((BaseJewel)item, 1, 10, 30);
            }

            AddItem(item);
        }
Exemple #16
0
        public WhitePearlBracelet()
        {
            Weight = 1.0;

            Attributes.NightSight = 1;
            int num_attributes = Utility.RandomMinMax(2, 5);

            BaseRunicTool.ApplyAttributesTo(this, num_attributes, 1, 100);

            if (Utility.Random(100) < 50 && num_attributes < 5)
            {
                switch (Utility.Random(3))
                {
                case 0:
                    Attributes.CastSpeed += 1;
                    if (Attributes.CastSpeed > 1)
                    {
                        Attributes.CastSpeed = 1;
                    }
                    break;

                case 1:
                    Attributes.CastRecovery += 2;
                    if (Attributes.CastRecovery > 3)
                    {
                        Attributes.CastRecovery = 3;
                    }
                    break;

                case 2:
                    Attributes.LowerRegCost += 10;
                    if (Attributes.LowerRegCost > 20)
                    {
                        Attributes.LowerRegCost = 20;
                    }
                    break;
                }
            }
        }
        public override int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            double magery = from.Skills.Magery.Value - 100;

            if (magery < 0)
            {
                magery = 0;
            }

            int count = (int)Math.Round(magery * Utility.RandomDouble() / 5);

            if (count > 2)
            {
                count = 2;
            }

            if (Utility.RandomDouble() < 0.5)
            {
                count = 0;
            }
            else
            {
                BaseRunicTool.ApplyAttributesTo(this, false, 0, count, 70, 80);
            }

            Attributes.SpellDamage   = 25;
            Attributes.LowerManaCost = 10;
            Attributes.CastSpeed     = 1;
            Attributes.CastRecovery  = 1;

            if (makersMark)
            {
                Crafter = from;
            }

            return(quality);
        }
Exemple #18
0
        public EcruCitrineRing()
        {
            Weight = 1.0;
            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(1, 4), 0, 100);

            switch (Utility.Random(3))
            {
            case 0:
                Attributes.EnhancePotions = 5;
                break;

            case 1:
                Attributes.EnhancePotions = (short)50;
                break;

            case 2:
                Attributes.BonusStr += 5;
                if (Attributes.BonusStr > 8)
                {
                    Attributes.BonusStr = 8;
                }
                break;
            }
        }
Exemple #19
0
        public TreasureMessageChest(int amount) : base()
        {
            Weight = (amount / 100) + 105;
            switch (Utility.RandomMinMax(1, 10))
            {
            case 1:
            default: Name = "Chest"; break;

            case 2: Name = "Metal Chest"; break;

            case 3: Name = "Paragon Chest"; break;

            case 4: Name = "Treasure Chest"; break;

            case 5: Name = "Ingot Box"; break;

            case 6: Name = "Loot Chest"; break;

            case 7: Name = "Prize Chest"; break;

            case 8: Name = "Rare Chest"; break;

            case 9: Name = "Tool Box"; break;

            case 10: Name = "Resource Box"; break;
            }
            Hue = Utility.RandomMinMax(2366, 2371);

            switch (Utility.Random(6))
            {
            case 0:
            default: TrapType = TrapType.None; break;

            case 1: TrapType = TrapType.PoisonTrap; break;

            case 2: TrapType = TrapType.DartTrap; break;

            case 3: TrapType = TrapType.MagicTrap; break;

            case 4: TrapType = TrapType.ExplosionTrap; break;
            }

            TrapPower = (int)(Utility.RandomMinMax(amount / 40, amount / 20));

            Locked       = true;
            LockLevel    = (int)(Utility.RandomMinMax(amount / 40, amount / 20));
            MaxLockLevel = LockLevel + 25;

            DropItem(new Gold(amount));

            int amountloot  = Utility.RandomMinMax((int)((amount / 100) + 5), (int)((amount / 100) + 15));
            int amountloot2 = (int)((amount / 200));

            if (amountloot2 > 10)
            {
                amountloot2 = 10;
            }
            for (int i = 0; i < amountloot; ++i)
            {
                if (Utility.RandomDouble() < .25)
                {
                    Item item = Loot.RandomGem();
                    item.Amount = Utility.RandomMinMax(amountloot - 3, amountloot + 5);
                    this.DropItem(item);
                }

                if (Utility.RandomDouble() < .25)
                {
                    Item item = Loot.RandomPossibleReagent();
                    item.Amount = Utility.RandomMinMax(amountloot - 3, amountloot + 5);
                    this.DropItem(item);
                }

                if (Utility.RandomDouble() < .25)
                {
                    this.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                }

                if (Utility.RandomDouble() < .10)
                {
                    Item item;
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                    int attributeCount = (int)(amountloot2 / 2);
                    if (attributeCount < 1)
                    {
                        attributeCount = 1;
                    }
                    if (attributeCount > 5)
                    {
                        attributeCount = 5;
                    }
                    int min = amountloot2 * 5;
                    int max = amountloot2 * 10;
                    if (max > 100)
                    {
                        max = 100;
                    }

                    if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;
                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                        this.DropItem(item);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;
                        BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                        this.DropItem(item);
                    }
                    else if (item is BaseJewel)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);
                        this.DropItem(item);
                    }
                    else if (item is BaseHat)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseHat)item, attributeCount, min, max);
                        this.DropItem(item);
                    }
                    else if (item != null)
                    {
                        this.DropItem(item);
                    }
                }
            }
        }
            protected override void OnTick()
            {
                Item gem = Loot.RandomGem();
                Item reg = Loot.RandomPossibleReagent();

                Item equip;

                equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if (m_Item != null)
                {
                    m_Item.IsDigging = false;
                }

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

                    int attributeCount;
                    int min, max;

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

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (equip is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)equip;

                    int attributeCount;
                    int min, max;

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

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (equip is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

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

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)equip, attributeCount, min, max);
                }

                if (m_From.Skills[SkillName.Mining].Base < 15.0)
                {
                    if (Utility.Random(100) < 65)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up a gem.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up a reagent.");
                            break;

                        case 2:
                            m_From.AddToBackpack(new Bone(Utility.RandomMinMax(2, 10)));
                            m_From.SendMessage("You dig up some bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 35.0)
                {
                    if (Utility.Random(100) < 55)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 4);
                        reg.Amount = Utility.RandomMinMax(2, 4);

                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(new Bone(Utility.RandomMinMax(2, 10)));
                            m_From.SendMessage("You dig up some bones.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 50.0)
                {
                    if (Utility.Random(100) < 45)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 10);
                        reg.Amount = Utility.RandomMinMax(2, 10);

                        switch (Utility.Random(6))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bone(Utility.RandomMinMax(2, 10)));
                            m_From.SendMessage("You dig up some bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 75.0)
                {
                    if (Utility.Random(100) < 35)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 20);
                        reg.Amount = Utility.RandomMinMax(2, 20);

                        switch (Utility.Random(7))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bone(Utility.RandomMinMax(2, 10)));
                            m_From.SendMessage("You dig up some bones.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new Gold(50, 150));
                            m_From.SendMessage("You dig up some gold.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 90.0)
                {
                    if (Utility.Random(100) < 25)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 30);
                        reg.Amount = Utility.RandomMinMax(2, 30);

                        switch (Utility.Random(9))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bone(Utility.RandomMinMax(2, 10)));
                            m_From.SendMessage("You dig up some bones.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new Gold(50, 150));
                            m_From.SendMessage("You dig up some gold.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("You dig up an ancient artifact.");
                            break;

                        case 8:
                            m_From.AddToBackpack(new SoulGem());
                            m_From.SendMessage("You dig up a strange, glowing stone.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if (Utility.Random(500) < 5)
                    {
                        m_From.SendMessage("You dig up and item of great value.");
                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(new ArmoredRobe());
                            break;

                        case 1:
                            m_From.AddToBackpack(new ButchersResolve());
                            break;

                        case 2:
                            m_From.AddToBackpack(new FollowerOfTheOldLord());
                            break;

                        case 3:
                            m_From.AddToBackpack(new SkirtOfTheAmazon());
                            break;

                        case 4:
                            m_From.AddToBackpack(new HolyHammerOfExorcism());
                            break;
                        }
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 40);
                        reg.Amount = Utility.RandomMinMax(2, 40);

                        switch (Utility.Random(9))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bone(Utility.RandomMinMax(2, 10)));
                            m_From.SendMessage("You dig up some bones.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new Gold(50, 150));
                            m_From.SendMessage("You dig up some gold.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("You dig up an ancient artifact.");
                            break;

                        case 8:
                            m_From.AddToBackpack(new SoulGem());
                            m_From.SendMessage("You dig up a strange, glowing stone.");
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("You fail to dig anything up.");
                }

                Stop();
            }
        private void Fill(int level)
        {
            TrapType  = TrapType.ExplosionTrap;
            TrapPower = level * 25;
            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 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)));
        }
Exemple #22
0
        public static void Fill(LockableContainer cont, int luck, int level, bool isSos, Map map)
        {
            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 = 5;
                    break;

                case 2:
                    cont.RequiredSkill = 45;
                    break;

                case 3:
                    cont.RequiredSkill = 65;
                    break;

                case 4:
                    cont.RequiredSkill = 75;
                    break;

                case 5:
                    cont.RequiredSkill = 75;
                    break;

                case 6:
                    cont.RequiredSkill = 80;
                    break;

                case 7:
                    cont.RequiredSkill = 80;
                    break;
                }

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

                cont.DropItem(new Gold(level * 5000));

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

                double propsScale = 1.0;
                if (Core.SE)
                {
                    switch (level)
                    {
                    case 1:
                        numberItems = 32;
                        propsScale  = 0.5625;
                        break;

                    case 2:
                        numberItems = 40;
                        propsScale  = 0.6875;
                        break;

                    case 3:
                        numberItems = 48;
                        propsScale  = 0.875;
                        break;

                    case 4:
                        numberItems = 56;
                        break;

                    case 5:
                        numberItems = 64;
                        break;

                    case 6:
                        numberItems = 72;
                        break;

                    case 7:
                        numberItems = 80;
                        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 != null && Core.HS && RandomItemGenerator.Enabled)
                    {
                        int min, max;
                        GetRandomItemStat(out min, out max, propsScale);

                        RunicReforging.GenerateRandomItem(item, luck, min, max, map);

                        cont.DropItem(item);
                    }
                    else 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 + 1;
            }

            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) + 1;
            }

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

            if (level > 1)
            {
                Item item = Loot.Construct(m_ImbuingIngreds[Utility.Random(m_ImbuingIngreds.Length)]);

                item.Amount = level;
                cont.DropItem(item);
            }

            Item arty    = null;
            Item special = null;

            if (isSos)
            {
                if (0.004 * level > Utility.RandomDouble())
                {
                    arty = Loot.Construct(m_SOSArtifacts);
                }
                if (0.006 * level > Utility.RandomDouble())
                {
                    special = Loot.Construct(m_SOSDecor);
                }
                else if (0.009 * level > Utility.RandomDouble())
                {
                    special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map);
                }
            }
            else
            {
                if (level >= 7)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelSevenOnly);
                    }
                    else if (0.10 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 6)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.10 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 5)
                {
                    if (0.05 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (.10 > Utility.RandomDouble())
                {
                    special = GetRandomSpecial(level, cont.Map);
                }
            }

            if (arty != null)
            {
                Container pack = new Backpack();
                pack.Hue = 1278;

                pack.DropItem(arty);
                cont.DropItem(pack);
            }

            if (special != null)
            {
                cont.DropItem(special);
            }

            if (Core.SA)
            {
                int rolls = 2;

                if (level >= 5)
                {
                    rolls += level - 2;
                }

                RefinementComponent.Roll(cont, rolls, 0.10);
            }
        }
        public TerathanIslandTreasureChest() : base(0x2DF1)
        {
            Name    = "a treasure chest -30-";
            Movable = true;
            Hue     = 285;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 30;
            LockLevel     = 30;
            MaxLockLevel  = 35;

            // Gold
            if (Utility.RandomDouble() < 0.25)
            {
                DropItem(new Gold(Utility.Random(45, 450)));
            }

/////////////////////////////////////// Books

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new TamersHandbookVol1());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new TamersHandbookVol2());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new TamersHandbookVol3());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new TamersHandbookVol4());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new TamersHandbookVol5());
            }

/////////////////////////////////////// Meats

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Bacon());
            }
            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Sausage());
            }

/////////////////////////////////////// Eating Utensils

            if (Utility.RandomDouble() < 0.08)
            {
                DropItem(new KnifeLeft());
            }
            if (Utility.RandomDouble() < 0.08)
            {
                DropItem(new KnifeRight());
            }
            if (Utility.RandomDouble() < 0.08)
            {
                DropItem(new PewterMug());
            }
            if (Utility.RandomDouble() < 0.08)
            {
                DropItem(new Plate());
            }
            if (Utility.RandomDouble() < 0.08)
            {
                DropItem(new SpoonLeft());
            }
            if (Utility.RandomDouble() < 0.08)
            {
                DropItem(new SpoonRight());
            }

/////////////////////////////////////// Jewelry

            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Agate());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Beryl());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new ChromeDiopside());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new FireOpal());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new MoonstoneCustom());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Onyx());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Opal());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Pearl());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new TurquoiseCustom());
            }

            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Bloodstone());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Citrine());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Demantoid());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Jasper());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Lolite());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Lupis());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Peridot());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Tsavorite());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Zircon());
            }


/////////////////////////////////////// Supplies

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Arrow(Utility.Random(17, 22)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Bolt(Utility.Random(17, 22)));
            }

            Item ReagentLoot = Loot.RandomReagent();

            ReagentLoot.Amount = Utility.Random(17, 22);
            DropItem(ReagentLoot);

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Bandage(Utility.Random(17, 22)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Bedroll());
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Bottle(Utility.Random(17, 22)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Lockpick(Utility.Random(17, 22)));
            }

            Item PotionLoot = Loot.RandomPotion();

            DropItem(PotionLoot);

            if (Utility.RandomDouble() < 0.20)
            {
                DropItem(new LesserPoisonPotion());
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new PoisonPotion());
            }

/////////////////////////////////////// Tools

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new FishingPole());
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Shovel());
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new Skillet());
            }

/////////////////////////////////////// Rare Items

            if (Utility.RandomDouble() < 0.01)
            {
                DropItem(new DyeTub());
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(38))
                {
                case 0: weapon = new Hatchet(); break;

                case 1: weapon = new Bow(); break;

                case 2: weapon = new Crossbow(); break;

                case 3: weapon = new Club(); break;

                case 4: weapon = new Mace(); break;

                case 5: weapon = new Maul(); break;

                case 6: weapon = new Pitchfork(); break;

                case 7: weapon = new ShortSpear(); break;

                case 8: weapon = new GnarledStaff(); break;

                case 9: weapon = new ShepherdsCrook(); break;

                case 10: weapon = new Cutlass(); break;

                case 11: weapon = new Katana(); break;

                case 12: weapon = new Kryss(); break;

                case 13: weapon = new Scimitar(); break;

                case 14: weapon = new AssassinSpike(); break;

                case 15: weapon = new DiamondMace(); break;

                case 16: weapon = new Leafblade(); break;

                case 17: weapon = new MagicalShortbow(); break;

                case 18: weapon = new RadiantScimitar(); break;

                case 19: weapon = new WildStaff(); break;

                case 20: weapon = new Axe(); break;

                case 21: weapon = new ExecutionersAxe(); break;

                case 22: weapon = new Pickaxe(); break;

                case 23: weapon = new TwoHandedAxe(); break;

                case 24: weapon = new WarAxe(); break;

                case 25: weapon = new HeavyCrossbow(); break;

                case 26: weapon = new HammerPick(); break;

                case 27: weapon = new WarMace(); break;

                case 28: weapon = new Spear(); break;

                case 29: weapon = new WarFork(); break;

                case 30: weapon = new BlackStaff(); break;

                case 31: weapon = new QuarterStaff(); break;

                case 32: weapon = new Longsword(); break;

                case 33: weapon = new ElvenCompositeLongbow(); break;

                case 34: weapon = new ElvenMachete(); break;

                case 35: weapon = new ElvenSpellblade(); break;

                case 36: weapon = new RuneBlade(); break;

                default: weapon = new Dagger(); break;
                }

                BaseRunicTool.ApplyAttributesTo(weapon, 2, 22, 25);
                weapon.Hue = 285;

                weapon.WeaponAttributes.HitLeechStam = 5;
                weapon.Attributes.BonusHits          = 10;

                DropItem(weapon);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                switch (Utility.Random(13))
                {
                case 0: armor = new FemaleStuddedChest(); break;

                case 1: armor = new StuddedArms(); break;

                case 2: armor = new StuddedBustierArms(); break;

                case 3: armor = new StuddedGloves(); break;

                case 4: armor = new StuddedGorget(); break;

                case 5: armor = new ChainCoif(); break;

                case 6: armor = new ChainChest(); break;

                case 7: armor = new ChainLegs(); break;

                case 8: armor = new RingmailArms(); break;

                case 9: armor = new RingmailChest(); break;

                case 10: armor = new RingmailGloves(); break;

                case 11: armor = new RingmailLegs(); break;

                default: armor = new StuddedChest(); break;
                }

                BaseRunicTool.ApplyAttributesTo(armor, 3, 22, 25);
                armor.Hue = 285;

                armor.Attributes.WeaponDamage = 3;

                DropItem(armor);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseHat hat = Loot.RandomHat(true);
                switch (Utility.Random(5))
                {
                case 0: hat = new BearMask(); break;

                case 1: hat = new DeerMask(); break;

                case 2: hat = new FeatheredHat(); break;

                case 3: hat = new WizardsHat(); break;

                default: hat = new TribalMask(); break;
                }

                BaseRunicTool.ApplyAttributesTo(hat, 3, 22, 25);
                hat.Hue = 285;

                hat.Attributes.BonusHits   = 10;
                hat.Attributes.SpellDamage = 5;
                hat.Resistances.Energy     = 10;

                DropItem(hat);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 22, 25);
                clothing.Hue = 285;

                clothing.Attributes.BonusHits    = 5;
                clothing.Attributes.DefendChance = 3;
                clothing.Resistances.Physical    = 5;

                DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseShield shield = new WoodenKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield, 3, 22, 25);
                }
                shield.Hue = 285;

                shield.Attributes.BonusHits = 10;

                DropItem(shield);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel bracelet = new GoldBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 3, 22, 25);
                }
                bracelet.Hue = 285;

                bracelet.Attributes.WeaponDamage = 5;
                bracelet.Attributes.DefendChance = 2;
                bracelet.Resistances.Fire        = 5;

                DropItem(bracelet);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 3, 22, 25);
                }
                earrings.Hue = 285;

                earrings.Attributes.WeaponDamage = 5;
                earrings.Attributes.DefendChance = 3;
                earrings.Resistances.Cold        = 5;

                DropItem(earrings);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel necklace = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 22, 25);
                }
                necklace.Hue = 285;

                necklace.Attributes.WeaponDamage = 5;
                necklace.Attributes.DefendChance = 5;
                necklace.Resistances.Energy      = 5;

                DropItem(necklace);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 3, 22, 25);
                }
                ring.Hue = 285;

                ring.Attributes.WeaponDamage = 5;
                ring.Attributes.DefendChance = 2;
                ring.Resistances.Poison      = 5;

                DropItem(ring);
            }
        }
        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.Felucca));
                }
            }
            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));
                }

                numberItems = level * 6;

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

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

                        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;

                        armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);

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

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

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

                        BaseRunicTool.ApplyAttributesTo(attributeCount);

                        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);
            }
        }
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;

            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;

                cont.DropItem(new Gold(level * 1000));

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

                for (int i = 0; i < level * 6; ++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 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)]));
            }
        }
Exemple #26
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 = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

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

                    int attributeCount;
                    int min, max;

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

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);

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

                    int attributeCount;
                    int min, max;

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

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);

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

                    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();
        }
Exemple #27
0
        public TownChestJeweler() : base(0xE43)
        {
            Name    = "a metal chest -20-";
            Movable = true;
            Weight  = 1000.0;

            Hue = 83;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 20;
            LockLevel     = 20;
            MaxLockLevel  = 25;

            // Gold
            if (Utility.RandomDouble() < 0.25)
            {
                DropItem(new Gold(Utility.Random(1, 25)));
            }

            // Supplies

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new GoldRing());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new GoldBracelet());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new GoldEarrings());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new GoldNecklace());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new GoldBeadNecklace());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new Necklace());
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new Beads());
            }

            // Gems

            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new Agate());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new Beryl());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new ChromeDiopside());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new FireOpal());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new MoonstoneCustom());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new Onyx());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new Opal());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new Pearl());
            }
            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new TurquoiseCustom());
            }

            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Bloodstone());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Citrine());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Demantoid());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Jasper());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Lolite());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Lupis());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Peridot());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Tsavorite());
            }
            if (Utility.RandomDouble() < 0.04)
            {
                DropItem(new Zircon());
            }

            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Amber());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Amethyst());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Andalusite());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Chrysoberyl());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Garnet());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Jade());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Mandarin());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Morganite());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Paraiba());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new TigerEye());
            }
            if (Utility.RandomDouble() < 0.03)
            {
                DropItem(new Tourmaline());
            }

            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Alexandrite());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Ametrine());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Kunzite());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Ruby());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Sapphire());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Tanzanite());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Topaz());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Zultanite());
            }

            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Diamond());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new Emerald());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new PinkQuartz());
            }
            if (Utility.RandomDouble() < 0.02)
            {
                DropItem(new StarSapphire());
            }

/////////////////////////////////////// Rare Items

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel bracelet = new SilverBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 3, 15, 20);
                }

                DropItem(bracelet);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 3, 15, 20);
                }

                DropItem(earrings);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel necklace = new SilverNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 15, 20);
                }

                DropItem(necklace);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 3, 15, 20);
                }

                DropItem(ring);
            }
        }
Exemple #28
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Blessed)
            {
                from.SendMessage("You cannot look through that while in this state.");
            }
            else if (!from.InRange(GetWorldLocation(), 3))
            {
                from.SendMessage("You will have to get closer to it!");
            }
            else if (m_Uses < 5)
            {
                m_Uses++;
                if (Server.Misc.GetPlayerInfo.LuckyPlayer(from.Luck) && Utility.RandomBool())
                {
                    m_Uses--;
                }

                from.PlaySound(0x2E5);
                from.SendMessage("You pull something from the treasure hoard!");

                Item item = null;

                switch (Utility.Random(17))
                {
                case 0:
                    item = Loot.RandomArty();
                    break;

                case 1:
                    item = DungeonLoot.RandomSlayer();
                    break;

                case 2:
                    item = Loot.RandomSArty();
                    break;

                case 3:
                    if (Server.Misc.GetPlayerInfo.EvilPlay(from) == true && Utility.RandomMinMax(0, 10) == 10)
                    {
                        item = DungeonLoot.RandomEvil();
                    }
                    else
                    {
                        item = Loot.RandomRelic();
                        if (item is DDRelicWeapon && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true)
                        {
                            Server.Items.DDRelicWeapon.MakeOriental(item);
                        }
                        else if (item is DDRelicStatue && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true)
                        {
                            Server.Items.DDRelicStatue.MakeOriental(item);
                        }
                        else if (item is DDRelicBanner && item.ItemID != 0x2886 && item.ItemID != 0x2887 && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true)
                        {
                            Server.Items.DDRelicBanner.MakeOriental(item);
                        }
                    }
                    break;

                case 4:
                    item = DungeonLoot.RandomRare();
                    if (item.Stackable == true)
                    {
                        item.Amount = Utility.RandomMinMax(5, 20);
                    }
                    break;

                case 5:
                    item = DungeonLoot.RandomLoreBooks();
                    break;

                case 6:
                    if (Utility.Random(4) != 1)
                    {
                        item = Loot.RandomScroll(0, 7, SpellbookType.Regular);
                    }
                    else
                    {
                        item = Loot.RandomScroll(0, 17, SpellbookType.Necromancer);
                    }
                    break;

                case 7:
                    int luckMod = from.Luck; if (luckMod > 2000)
                    {
                        luckMod = 2000;
                    }

                    if ((Region.Find(from.Location, from.Map)).IsPartOf("the Ancient Crash Site") ||
                        (Region.Find(from.Location, from.Map)).IsPartOf("the Ancient Sky Ship"))
                    {
                        item = new DDXormite((luckMod + Utility.RandomMinMax(333, 666)));
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Mines of Morinia")
                    {
                        item = new Crystals((luckMod + Utility.RandomMinMax(200, 400)));
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld")
                    {
                        item = new DDJewels((luckMod + Utility.RandomMinMax(500, 1000)));
                    }
                    else
                    {
                        item = new Gold((luckMod + Utility.RandomMinMax(1000, 2000)));
                    }
                    break;

                case 8:
                case 9:
                case 10:
                case 11:
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(Server.LootPackEntry.IsInIslesDread(from));
                    ContainerFunctions.LootMutate(from, Server.LootPack.GetRegularLuckChance(from), item, from.Backpack, Utility.RandomMinMax(5, 10));
                    break;

                case 12:
                    item = Loot.RandomInstrument();

                    int attributeCount;
                    int min, max;
                    Server.Misc.ContainerFunctions.GetRandomAOSStats(out attributeCount, out min, out max, 6);

                    BaseInstrument instr = (BaseInstrument)item;

                    int cHue = 0;
                    int cUse = 0;

                    switch (instr.Resource)
                    {
                    case CraftResource.AshTree: cHue = MaterialInfo.GetMaterialColor("ash", "", 0); cUse = 20; break;

                    case CraftResource.CherryTree: cHue = MaterialInfo.GetMaterialColor("cherry", "", 0); cUse = 40; break;

                    case CraftResource.EbonyTree: cHue = MaterialInfo.GetMaterialColor("ebony", "", 0); cUse = 60; break;

                    case CraftResource.GoldenOakTree: cHue = MaterialInfo.GetMaterialColor("gold", "", 0); cUse = 80; break;

                    case CraftResource.HickoryTree: cHue = MaterialInfo.GetMaterialColor("hickory", "", 0); cUse = 100; break;

                    case CraftResource.MahoganyTree: cHue = MaterialInfo.GetMaterialColor("mahogany", "", 0); cUse = 120; break;

                    case CraftResource.DriftwoodTree: cHue = MaterialInfo.GetMaterialColor("driftwood", "", 0); cUse = 120; break;

                    case CraftResource.OakTree: cHue = MaterialInfo.GetMaterialColor("oak", "", 0); cUse = 140; break;

                    case CraftResource.PineTree: cHue = MaterialInfo.GetMaterialColor("pine", "", 0); cUse = 160; break;

                    case CraftResource.RosewoodTree: cHue = MaterialInfo.GetMaterialColor("rosewood", "", 0); cUse = 180; break;

                    case CraftResource.WalnutTree: cHue = MaterialInfo.GetMaterialColor("walnute", "", 0); cUse = 200; break;
                    }

                    if (!(Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map)))
                    {
                        if (cHue > 0)
                        {
                            item.Hue = cHue;
                        }
                        else if (Utility.RandomMinMax(1, 4) == 1)
                        {
                            item.Hue = Utility.RandomColor(0);
                        }
                        Server.Misc.MorphingTime.MakeOrientalItem(item, from);
                        item.Name = LootPackEntry.MagicItemName(item, from, Region.Find(from.Location, from.Map));
                    }
                    else
                    {
                        string newName = "odd alien";
                        switch (Utility.RandomMinMax(0, 6))
                        {
                        case 0: newName = "odd"; break;

                        case 1: newName = "unusual"; break;

                        case 2: newName = "bizarre"; break;

                        case 3: newName = "curious"; break;

                        case 4: newName = "peculiar"; break;

                        case 5: newName = "strange"; break;

                        case 6: newName = "weird"; break;
                        }

                        switch (Utility.RandomMinMax(1, 4))
                        {
                        case 1: item = new Pipes();             item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " pipes";           break;

                        case 2: item = new Pipes();             item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " pan flute";       break;

                        case 3: item = new Fiddle();    item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " violin";          break;

                        case 4: item = new Fiddle();    item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " fiddle";          break;
                        }

                        BaseInstrument lute = (BaseInstrument)item;
                        lute.Resource = CraftResource.None;

                        item.Hue = Utility.RandomColor(0);
                    }

                    instr.UsesRemaining = instr.UsesRemaining + cUse;

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

                    SlayerName slayer = BaseRunicTool.GetRandomSlayer();

                    instr.Quality = InstrumentQuality.Regular;
                    if (Utility.RandomMinMax(1, 4) == 1)
                    {
                        instr.Quality = InstrumentQuality.Exceptional;
                    }

                    if (Utility.RandomMinMax(1, 4) == 1)
                    {
                        instr.Slayer = slayer;
                    }

                    break;

                case 13:
                    item = Loot.RandomGem();
                    break;

                case 14:
                    item = Loot.RandomPotion();
                    break;

                case 15:
                    item = Loot.RandomWand(); Server.Misc.MaterialInfo.ColorMetal(item, 0); string wandOwner = ""; if (Utility.RandomMinMax(1, 3) == 1)
                    {
                        wandOwner = Server.LootPackEntry.MagicWandOwner() + " ";
                    }
                    item.Name = wandOwner + item.Name;
                    break;

                case 16:
                    m_Uses = 6;                             // STOP GIVING LOOT WHEN THEY GET A CONTAINER
                    int chestLuck = Server.Misc.GetPlayerInfo.LuckyPlayerArtifacts(from.Luck);
                    if (chestLuck < 3)
                    {
                        chestLuck = 3;
                    }
                    if (chestLuck > 8)
                    {
                        chestLuck = 8;
                    }
                    item        = new LootChest(Utility.RandomMinMax(3, chestLuck));
                    item.ItemID = Utility.RandomList(0x9AB, 0xE40, 0xE41, 0xE7C);
                    item.Hue    = Utility.RandomList(0x961, 0x962, 0x963, 0x964, 0x965, 0x966, 0x967, 0x968, 0x969, 0x96A, 0x96B, 0x96C, 0x96D, 0x96E, 0x96F, 0x970, 0x971, 0x972, 0x973, 0x974, 0x975, 0x976, 0x977, 0x978, 0x979, 0x97A, 0x97B, 0x97C, 0x97D, 0x97E, 0x4AA);

                    Region reg = Region.Find(from.Location, from.Map);

                    string box = "hoard chest";
                    switch (Utility.RandomMinMax(0, 7))
                    {
                    case 0: box = "hoard chest";            break;

                    case 1: box = "treasure chest";         break;

                    case 2: box = "secret chest";           break;

                    case 3: box = "fabled chest";           break;

                    case 4: box = "legendary chest";        break;

                    case 5: box = "mythical chest";         break;

                    case 6: box = "lost chest";                     break;

                    case 7: box = "stolen chest";           break;
                    }

                    if (Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        Server.Misc.ContainerFunctions.MakeSpaceCrate(((LockableContainer)item));
                        box = item.Name;
                    }

                    switch (Utility.RandomMinMax(0, 1))
                    {
                    case 0: item.Name = box + " from " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location);       break;

                    case 1: item.Name = box + " of " + HoardName;   break;
                    }
                    int xTraCash = Utility.RandomMinMax(5000, 8000);

                    int zone = 0;
                    if (Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        zone = 1;
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld")
                    {
                        zone = 2;
                    }

                    ContainerFunctions.AddGoldToContainer(xTraCash, (LootChest)item, zone, from);
                    int artychance = GetPlayerInfo.LuckyPlayerArtifacts(from.Luck) + 10;
                    if (Utility.RandomMinMax(0, 100) < artychance)
                    {
                        Item artys = Loot.RandomArty(); ((LootChest)item).DropItem(artys); BaseContainer.DropItemFix(artys, from, ((LootChest)item).ItemID, ((LootChest)item).GumpID);
                    }
                    break;
                }

                if (item != null)
                {
                    if (Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        Server.Misc.MorphingTime.MakeSpaceAceItem(item, from);
                    }

                    if (item is Container)
                    {
                        item.MoveToWorld(from.Location, from.Map);
                    }
                    else
                    {
                        from.AddToBackpack(item);
                    }
                }
                else
                {
                    if (Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        item = new DDXormite((from.Luck + Utility.RandomMinMax(333, 666)));
                    }
                    else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld")
                    {
                        item = new DDJewels((from.Luck + Utility.RandomMinMax(500, 1000)));
                    }
                    else
                    {
                        item = new Gold((from.Luck + Utility.RandomMinMax(1000, 2000)));
                    }
                    if (item != null)
                    {
                        from.AddToBackpack(item);
                    }
                }
            }
            else
            {
                from.SendMessage("There is nothing else worth taking from this pile!");
                this.Delete();
            }
        }
Exemple #29
0
        public ElfCityChestClothier() : base(0x2DF2)
        {
            Name    = "a metal chest -5-";
            Hue     = 663;
            Movable = true;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 5;
            LockLevel     = 5;
            MaxLockLevel  = 10;

            // Gold
            if (Utility.RandomDouble() < 0.25)
            {
                DropItem(new Gold(Utility.Random(1, 25)));
            }

            // Supplies

            if (Utility.RandomDouble() < 0.20)
            {
                DropItem(new Cotton(Utility.Random(25, 50)));
            }

            if (Utility.RandomDouble() < 0.20)
            {
                DropItem(new Wool(Utility.Random(25, 50)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new DarkYarn(Utility.Random(25, 50)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new LightYarn(Utility.Random(25, 50)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new LightYarnUnraveled(Utility.Random(25, 50)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                DropItem(new SpoolOfThread(Utility.Random(25, 50)));
            }

            if (Utility.RandomDouble() < 0.20)
            {
                DropItem(new BoltOfCloth(Utility.Random(20, 45)));
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new Dyes());
            }

            if (Utility.RandomDouble() < 0.25)
            {
                DropItem(new Leather(Utility.Random(15, 35)));
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                switch (Utility.Random(7))
                {
                case 0: clothing = new ElvenDarkShirt(); break;

                case 1: clothing = new ElvenPants(); break;

                case 2: clothing = new ElvenRobe(); break;

                case 3: clothing = new ElvenShirt(); break;

                case 4: clothing = new FemaleElvenRobe(); break;

                case 5: clothing = new WoodlandBelt(); break;

                default: clothing = new ElvenBoots(); break;
                }

                BaseRunicTool.ApplyAttributesTo(clothing, 3, 15, 20);

                DropItem(clothing);
            }
        }
        public static void Fill(Mobile from, LockableContainer cont, int level, bool isSos)
        {
            var map  = from.Map;
            var luck = from is PlayerMobile ? ((PlayerMobile)from).RealLuck : from.Luck;

            cont.Movable = false;
            cont.Locked  = true;
            int count;

            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 = 5;
                    break;

                case 2:
                    cont.RequiredSkill = 45;
                    break;

                case 3:
                    cont.RequiredSkill = 65;
                    break;

                case 4:
                    cont.RequiredSkill = 75;
                    break;

                case 5:
                    cont.RequiredSkill = 75;
                    break;

                case 6:
                    cont.RequiredSkill = 80;
                    break;

                case 7:
                    cont.RequiredSkill = 80;
                    break;
                }

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

                #region Gold
                cont.DropItem(new Gold(isSos ? level * 10000 : level * 5000));
                #endregion

                #region Scrolls
                if (isSos)
                {
                    switch (level)
                    {
                    default: count = 20; break;

                    case 0:
                    case 1: count = Utility.RandomMinMax(2, 5); break;

                    case 2: count = Utility.RandomMinMax(10, 15); break;
                    }
                }
                else
                {
                    count = level * 5;
                }

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

                #region Magical Items
                double propsScale = 1.0;

                switch (level)
                {
                case 1:
                    count      = isSos ? Utility.RandomMinMax(2, 6) : 32;
                    propsScale = 0.5625;
                    break;

                case 2:
                    count      = isSos ? Utility.RandomMinMax(10, 15) : 40;
                    propsScale = 0.6875;
                    break;

                case 3:
                    count      = isSos ? Utility.RandomMinMax(15, 20) : 48;
                    propsScale = 0.875;
                    break;

                case 4:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 56;
                    break;

                case 5:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 64;
                    break;

                case 6:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 72;
                    break;

                case 7:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 80;
                    break;

                default:
                    count = 0;
                    break;
                }

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

                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                    if (item != null && RandomItemGenerator.Enabled)
                    {
                        int min, max;
                        GetRandomItemStat(out min, out max, propsScale);

                        RunicReforging.GenerateRandomItem(item, luck, min, max, map);

                        cont.DropItem(item);
                    }
                    else if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        int attributeCount;
                        int min, max;

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

                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);

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

                        int attributeCount;
                        int min, max;

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

                        BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);

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

                        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);
                    }
                }
            }
            #endregion

            #region Reagents
            if (isSos)
            {
                switch (level)
                {
                default: count = Utility.RandomMinMax(45, 60); break;

                case 0:
                case 1: count = Utility.RandomMinMax(15, 20); break;

                case 2: count = Utility.RandomMinMax(25, 40); break;
                }
            }
            else
            {
                count = level == 0 ? 12 : Utility.RandomMinMax(40, 60) * (level + 1);
            }

            for (int i = 0; i < count; i++)
            {
                cont.DropItemStacked(Loot.RandomPossibleReagent());
            }
            #endregion

            #region Gems
            if (level == 0)
            {
                count = 2;
            }
            else
            {
                count = (level * 3) + 1;
            }

            for (int i = 0; i < count; i++)
            {
                cont.DropItem(Loot.RandomGem());
            }
            #endregion

            #region Imbuing Ingreds
            if (level > 1)
            {
                Item item = Loot.Construct(m_ImbuingIngreds[Utility.Random(m_ImbuingIngreds.Length)]);

                item.Amount = level;
                cont.DropItem(item);
            }
            #endregion

            Item arty    = null;
            Item special = null;

            if (isSos)
            {
                if (0.004 * level > Utility.RandomDouble())
                {
                    arty = Loot.Construct(m_SOSArtifacts);
                }
                if (0.006 * level > Utility.RandomDouble())
                {
                    special = Loot.Construct(m_SOSDecor);
                }
                else if (0.009 * level > Utility.RandomDouble())
                {
                    special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map);
                }
            }
            else
            {
                if (level >= 7)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelSevenOnly);
                    }
                    else if (0.10 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 6)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.20 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 5)
                {
                    if (0.005 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.15 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (.10 > Utility.RandomDouble())
                {
                    special = GetRandomSpecial(level, cont.Map);
                }
            }

            if (arty != null)
            {
                Container pack = new Backpack();
                pack.Hue = 1278;

                pack.DropItem(arty);
                cont.DropItem(pack);
            }

            if (special != null)
            {
                cont.DropItem(special);
            }

            int rolls = 2;

            if (level >= 5)
            {
                rolls += level - 2;
            }

            RefinementComponent.Roll(cont, rolls, 0.10);
        }