public void AddTinker( CraftResource cr, BaseRunicTool brt, Mobile from)
		{
			if ( ht_Tinker == null )
				ht_Tinker = new Hashtable();
			int i_Have = 0;
			if ( ht_Tinker[cr] != null )
				i_Have = (int)ht_Tinker[cr];

			if ( i_Have < 60000 )
			{
				if ( i_Have + brt.UsesRemaining > 60000 )
				{
					brt.UsesRemaining = i_Have + brt.UsesRemaining - 60000;
					i_Have = 60000;
				}
				else
				{
					i_Have += brt.UsesRemaining;
					brt.Delete();
				}

				if ( ht_Tinker.ContainsKey(cr) )
					ht_Tinker[cr] = i_Have;
				else
					ht_Tinker.Add(cr, i_Have);
				
				BeginCombine( from );
				from.SendGump( new RunicHouseGump( from, this ) );
				from.SendMessage(88, "You added the runic charges.");
				return;
			}
			from.SendGump( new RunicHouseGump( from, this ) );
			from.SendMessage(33, "You can't add more charges, the limit is 60,000.");
		}
Beispiel #2
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;
            }
        }
Beispiel #3
0
        public void OnTargetGears(Mobile from, object targ)
        {
            Gears g = targ as Gears;

            if (g == null || !g.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1010623);                   // You must use gears.
            }
            else if (IsModified)
            {
                from.SendMessage("That has already been modified.");
            }
            else if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to modify it.");
            }
            else if (from.Skills[SkillName.Fletching].Base < 100.0)
            {
                from.SendMessage("Only a grandmaster bowcrafter can modify this weapon.");
            }
            else
            {
                g.Consume();

                Hue = 0x453;

                Slayer = BaseRunicTool.GetRandomSlayer();

                if (0.05 > Utility.RandomDouble())
                {
                    Slayer2 = BaseRunicTool.GetRandomSlayer();
                }

                from.SendMessage("You modify it.");
            }
        }
        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   = 15;
            Attributes.LowerManaCost = 10;
            Attributes.BonusInt      = 8;

            if (makersMark)
            {
                Crafter = from;
            }

            return(quality);
        }
        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)]));
            }
        }
Beispiel #6
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);
            }
        }
Beispiel #7
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();
            }
        }
        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);
        }
        public IguanaCoveBossChest() : base(0xE43)
        {
            Name    = "a treasure chest -50-";
            Movable = true;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 50;
            LockLevel     = 50;
            MaxLockLevel  = 80;

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

/////////////////////////////////////// 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());
            }

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

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

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

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

            switch (Utility.Random(18))
            {
            case 0: DropItem(new Board(80)); break;

            case 1: DropItem(new BoltOfCloth(80)); break;

            case 2: DropItem(new Bottle(80)); break;

            case 3: DropItem(new CopperWire(80)); break;

            case 4: DropItem(new Cotton(80)); break;

            case 5: DropItem(new DarkYarn(80)); break;

            case 6: DropItem(new Feather(80)); break;

            case 7: DropItem(new Flax(80)); break;

            case 8: DropItem(new Gears(80)); break;

            case 9: DropItem(new GoldWire(80)); break;

            case 10: DropItem(new IronIngot(80)); break;

            case 11: DropItem(new IronWire(80)); break;

            case 12: DropItem(new Leather(80)); break;

            case 13: DropItem(new LightYarn(80)); break;

            case 14: DropItem(new Shaft(80)); break;

            case 15: DropItem(new SilverWire(80)); break;

            case 16: DropItem(new SpoolOfThread(80)); break;

            case 17: DropItem(new Springs(80)); break;

            case 18: DropItem(new Wool(80)); break;
            }

            switch (Utility.Random(5))
            {
            case 0: DropItem(new ArcaneStone(25)); break;

            case 1: DropItem(new BeetleEgg(25)); break;

            case 2: DropItem(new DragonScale(25)); break;

            case 3: DropItem(new FishScale(25)); break;

            case 4: DropItem(new SerpentScale(25)); break;
            }

            Item ReagentLoot = Loot.RandomReagent();

            ReagentLoot.Amount = Utility.RandomMinMax(50, 100);
            DropItem(ReagentLoot);

            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new SackFlour());
            }

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

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

/////////////////////////////////////// LV 20-30
            if (Utility.RandomDouble() < 0.10)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(31))
                {
                case 0: weapon = new DoubleAxe(); break;                      // Lv20

                case 1: weapon = new TwoHandedAxe(); break;                   // Lv25

                case 2: weapon = new WarAxe(); break;                         // Lv30

                case 3: weapon = new CompositeBow(); break;                   // Lv20

                case 4: weapon = new EbonyCrossbow(); break;                  // Lv20

                case 5: weapon = new FireBow(); break;                        // Lv25

                case 6: weapon = new GrassBow(); break;                       // Lv25

                case 7: weapon = new IceBow(); break;                         // Lv25

                case 8: weapon = new LightningBow(); break;                   // Lv25

                case 9: weapon = new EbonyWarBow(); break;                    // Lv30

                case 10: weapon = new PistolCrossbow(); break;                // Lv30

                case 11: weapon = new EbonyDualDaggers(); break;              // Lv20

                case 12: weapon = new Tekagi(); break;                        // Lv25

                case 13: weapon = new ElvenSpellblade(); break;               // Lv30

                case 14: weapon = new WarMace(); break;                       // Lv20

                case 15: weapon = new Tessen(); break;                        // Lv25

                case 16: weapon = new HammerPick(); break;                    // Lv30

                case 17: weapon = new Spear(); break;                         // Lv20

                case 18: weapon = new BoneSpear(); break;                     // Lv25

                case 19: weapon = new BubbleStaff(); break;                   // Lv25

                case 20: weapon = new CrystalStaff(); break;                  // Lv25

                case 21: weapon = new EnergyStaff(); break;                   // Lv25

                case 22: weapon = new FireStaff(); break;                     // Lv25

                case 23: weapon = new VineStaff(); break;                     // Lv25

                case 24: weapon = new BlackStaff(); break;                    // Lv30

                case 25: weapon = new VikingSword(); break;                   // Lv20

                case 26: weapon = new Wakizashi(); break;                     // Lv20

                case 27: weapon = new Daisho(); break;                        // Lv30

                case 28: weapon = new EbonyScimitar(); break;                 // Lv30

                case 29: weapon = new RuneBlade(); break;                     // Lv30

                default: weapon = new Longsword(); break;                     // Lv20
                }

                BaseRunicTool.ApplyAttributesTo(weapon, 2, 5, 50);
                DropItem(weapon);
            }

/////////////////////////////////////// LV 18-27
            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                switch (Utility.Random(18))
                {
                case 0: armor = new HideFemaleChest(); break;                   // Lv18

                case 1: armor = new HideGloves(); break;                        // Lv18

                case 2: armor = new HideGorget(); break;                        // Lv18

                case 3: armor = new HidePants(); break;                         // Lv18

                case 4: armor = new HidePauldrons(); break;                     // Lv18

                case 5: armor = new StuddedDo(); break;                         // Lv21

                case 6: armor = new StuddedHaidate(); break;                    // Lv21

                case 7: armor = new StuddedHiroSode(); break;                   // Lv21

                case 8: armor = new StuddedMempo(); break;                      // Lv21

                case 9: armor = new StuddedSuneate(); break;                    // Lv21

                case 10: armor = new VikingStuddedArms(); break;                // Lv24

                case 11: armor = new VikingStuddedCap(); break;                 // Lv24

                case 12: armor = new VikingStuddedChest(); break;               // Lv24

                case 13: armor = new VikingStuddedLegs(); break;                // Lv24

                case 14: armor = new ChainChest(); break;                       // Lv27

                case 15: armor = new ChainCoif(); break;                        // Lv27

                case 16: armor = new ChainLegs(); break;                        // Lv27

                default: armor = new HideChest(); break;                        // Lv18
                }

                BaseRunicTool.ApplyAttributesTo(armor, 3, 5, 50);
                DropItem(armor);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseHat hat = Loot.RandomHat(true);
                BaseRunicTool.ApplyAttributesTo(hat, 3, 12, 15);
                DropItem(hat);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 12, 15);
                DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield1 = new MetalShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield1, 3, 5, 50);
                }
                DropItem(shield1);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield2 = new WoodenKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield2, 3, 5, 50);
                }
                DropItem(shield2);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield3 = new MetalKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield3, 3, 5, 50);
                }
                DropItem(shield3);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel bracelet = new SilverBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 3, 12, 15);
                }
                DropItem(bracelet);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 3, 12, 15);
                }
                DropItem(earrings);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel necklace = new SilverNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 12, 15);
                }
                DropItem(necklace);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 3, 12, 15);
                }
                DropItem(ring);
            }
        }
Beispiel #10
0
        public virtual int OnCraft(
            int quality,
            bool makersMark,
            Mobile from,
            CraftSystem craftSystem,
            Type typeRes,
            ITool tool,
            CraftItem craftItem,
            int resHue)
        {
            int magery = from.Skills.Magery.BaseFixedPoint;

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

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

                    minIntensity = 55;
                    maxIntensity = 75;
                }
                else if (magery >= 900)
                {
                    propertyCounts = m_MasterPropertyCounts;
                    minIntensity   = 25;
                    maxIntensity   = 45;
                }
                else
                {
                    propertyCounts = m_AdeptPropertyCounts;
                    minIntensity   = 0;
                    maxIntensity   = 15;
                }

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

                GuaranteedSpellbookImprovementTalisman talisman = from.FindItemOnLayer(Layer.Talisman) as GuaranteedSpellbookImprovementTalisman;

                if (talisman != null && talisman.Charges > 0)
                {
                    propertyCount++;
                    talisman.Charges--;

                    from.SendLocalizedMessage(1157210); // Your talisman magically improves your spellbook.

                    if (talisman.Charges <= 0)
                    {
                        from.SendLocalizedMessage(1157211); // Your talisman has been destroyed.
                        talisman.Delete();
                    }
                }

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

            if (makersMark)
            {
                Crafter = from;
            }

            m_Quality = (BookQuality)(quality - 1);

            return(quality);
        }
Beispiel #11
0
 public RunicReforgingTarget(BaseRunicTool tool)
     : base(-1, false, TargetFlags.None)
 {
     m_Tool = tool;
 }
Beispiel #12
0
        public RunicReforgingGump(Mobile from, Item toReforge, BaseRunicTool tool, ReforgingOption options, ReforgedPrefix prefix, ReforgedSuffix suffix)
            : base(25, 25)
        {
            m_Tool = tool;
            m_ToReforge = toReforge;
            m_Options = options;
            m_Prefix = prefix;
            m_Suffix = suffix;

            AddBackground(0, 0, 374, 444, 83);

            AddHtmlObject(120, 13, 200, 20, 1151952, DarkGreen, false, false); // Runic Crafting Options

            int buttonHue = White;
            int buttonID = 0x4005;
            int y = 40;
            int idx = 0;

            for(int i = 0; i < Options.Length; i++)
            {
                ReforgingOption option = Options[i];

                if ((m_Options & option) != 0)
                {
                    if (CanReforge(from, option) && HasMetPrerequisite(option))
                    {
                        buttonHue = LightGreen;
                        buttonID = 4006;
                    }
                    else
                    {
                        buttonHue = Orange;
                        buttonID = 4006;
                    }
                }
                else
                {
                    if (CanReforge(from, option) && HasMetPrerequisite(option))
                    {
                        buttonHue = White;
                        buttonID = 4005;
                    }
                    else
                    {
                        buttonHue = Orange;
                        buttonID = 4006;
                    }
                }

                if(HasMetPrerequisite(option) && CanReforge(from, option))
                    AddButton(15, y, buttonID, buttonID, i + 100, GumpButtonType.Reply, 0);

                AddHtmlObject(55, y, 250, 20, GetCliloc(option), buttonHue, false, false);

                y += 25;
                idx++;
            }

            int totalCharges = GetTotalCharges();

            if ((m_Options & ReforgingOption.InspiredArtifice) != 0)
            {
                AddButton(15, 305, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlObject(55, 305, 250, 20, 1152087, White, false, false);
                AddHtmlObject(190, 305, 250, 20, RunicReforging.GetName((int)m_Prefix), LightGreen, false, false);
            }

            if ((m_Options & ReforgingOption.SublimeArtifice) != 0)
            {
                AddButton(15, 330, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddHtmlObject(55, 330, 250, 20, 1152088, White, false, false);
                AddHtmlObject(190, 330, 250, 20, RunicReforging.GetName((int)m_Suffix), LightGreen, false, false);
            }

            AddHtmlObject(30, 360, 200, 20, 1152078, LightGreen, false, false); // CHARGES NEEDED:
            AddHtmlObject(160, 360, 50, 20, totalCharges.ToString(), LightGreen, false, false);

            AddHtmlObject(45, 380, 200, 20, 1152077, LightGreen, false, false); // TOOL CHARGES:
            AddHtmlObject(160, 380, 50, 20, m_Tool.UsesRemaining.ToString(), LightGreen, false, false);

            AddButton(15, 410, 4017, 4018, 0, GumpButtonType.Reply, 0);
            AddHtmlObject(55, 410, 200, 20, "CLOSE", White, false, false);

            AddButton(330, 360, 4014, 4016, 3, GumpButtonType.Reply, 0);
            AddHtmlObject(230, 360, 200, 20, 1152080, White, false, false); // REFORGE ITEM

            AddButton(330, 410, 4011, 4013, 4, GumpButtonType.Reply, 0);
            AddHtmlObject(290, 410, 100, 20, "HELP", White, false, false);
        }
Beispiel #13
0
            private bool HasSelection(int index, Item toreforge, BaseRunicTool tool)
            {
                // No Vampire prefix/suffix for non-weapons
                if (index == 6 && !(toreforge is BaseWeapon))
                    return false;

                if (index != 0 && (index == (int)m_Prefix || index == (int)m_Suffix))
                    return false;

                return true;
            }
Beispiel #14
0
 public RunicReforgingGump(Mobile from, Item toReforge, BaseRunicTool tool) : this(from, toReforge, tool, ReforgingOption.None, ReforgedPrefix.None, ReforgedSuffix.None)
 {
 }
        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);
            }
        }
        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)));
        }
        protected override void GenerateTreasure()
        {
            DropItem(new Gold(600, 900));

            ArrayList gems = new ArrayList();

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

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

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

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


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

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

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

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

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

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

                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                    }
                    else
                    {
                        weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                    }

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

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

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

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

                    DropItem(item);
                }
                else if (item is 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();
        }
Beispiel #18
0
            public ItemNameGump(Item toreforge, BaseRunicTool tool, ReforgingOption options, ReforgedPrefix prefix, ReforgedSuffix suffix, bool isprefix)
                : base(25, 25)
            {
                m_Tool = tool;
                m_ToReforge = toreforge;
                m_Options = options;
                m_Prefix = prefix;
                m_Suffix = suffix;
                m_IsPrefix = isprefix;

                AddBackground(0, 0, 376, 445, 83);

                AddHtmlObject(72, 10, 250, 100, 1152089, DarkGreen, false, false);

                int buttonID = 4005;
                int buttonHue = White;
                int y = 50;

                foreach (int i in Enum.GetValues(typeof(ReforgedPrefix)))
                {
                    if ((isprefix && prefix == (ReforgedPrefix)i) || (!isprefix && suffix == (ReforgedSuffix)i))
                    {
                        buttonID = 4006;
                        buttonHue = LightGreen;
                    }
                    else
                    {
                        buttonID = 4005;
                        buttonHue = White;
                    }

                    if(HasSelection(i, toreforge, tool))
                    {
                        AddButton(15, y, buttonID, buttonID, 100 + i, GumpButtonType.Reply, 0);
                        AddHtmlObject(55, y, 250, 20, RunicReforging.GetName(i), buttonHue, false, false);
                    }

                    y += 25;
                }

                AddHtmlObject(55, 410, 100, 20, "CLOSE", White, false, false);
                AddButton(15, 410, 4017, 4019, 0, GumpButtonType.Reply, 0);
            }
Beispiel #19
0
        public static void Fill(LockableContainer cont, int level, Map map)
        {
            cont.Movable = false;
            cont.Locked  = true;

            #region Lock & Trap
            cont.TrapType    = TrapType.ExplosionTrap;
            cont.TrapPower   = level * 25;
            cont.TrapLevel   = level;
            cont.TrapEnabled = true;

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

            #region Gold
            cont.DropItem(new Gold(level * 5000));
            #endregion

            #region Reagents
            int reagentStackCount = level + 3;

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

            #region Magic Items
            int magicItemCount = 24 + (8 * level);

            for (int i = 0; i < magicItemCount; ++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);

                    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 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 Gems
            int gemCount = level * 3;

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

            #region Essences
            if (level >= 2)
            {
                int essenceCount = level;

                for (int i = 0; i < essenceCount; i++)
                {
                    Item item = Loot.RandomEssence();
                    cont.DropItem(item);
                }
            }
            #endregion

            #region Special loot
            if (map == Map.Felucca && (level * 0.15) > Utility.RandomDouble())
            {
                Item item = ScrollOfTranscendence.CreateRandom(5);
                cont.DropItem(item);
            }

            if ((level * 0.1) > Utility.RandomDouble())
            {
                cont.DropItem(new TastyTreat());
            }

            if ((level * 0.05) > Utility.RandomDouble())
            {
                cont.DropItem(new CreepingVine());
            }

            if ((level * 0.05) > Utility.RandomDouble())
            {
                cont.DropItem(Server.Engines.Quests.BaseReward.RandomRecipe());
            }

            if (0.5 > Utility.RandomDouble())
            {
                cont.DropItem(new TreasureMap(level < 6 && 0.25 > Utility.RandomDouble() ? level + 1 : level));
            }

            if (0.25 > Utility.RandomDouble())
            {
                cont.DropItem(new SkeletonKey());
            }

            if (0.2 > Utility.RandomDouble())
            {
                cont.DropItem(ScrollOfAlacrity.CreateRandom());
            }

            if (0.2 > Utility.RandomDouble())
            {
                cont.DropItem(new MessageInABottle());
            }

            if (level >= 5)
            {
                if (0.1 > Utility.RandomDouble())
                {
                    cont.DropItem(new ForgedPardon());
                }

                if (0.09 > Utility.RandomDouble())
                {
                    cont.DropItem(new ManaPhasingOrb());
                }

                if (0.09 > Utility.RandomDouble())
                {
                    cont.DropItem(new RunedSashOfWarding());
                }

                if (0.09 > Utility.RandomDouble())
                {
                    cont.DropItem(map == Map.TerMur ? new GargishSurgeShield() : new SurgeShield());
                }
            }
            #endregion

            #region Artifacts
            if (level >= 6)
            {
                Item item = (Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]);
                cont.DropItem(item);
            }
            #endregion
        }
        public IguanaCoveTreasureChest1() : base(0xE43)
        {
            Name    = "a treasure chest -40-";
            Movable = true;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 40;
            LockLevel     = 40;
            MaxLockLevel  = 80;

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

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

            switch (Utility.Random(19))
            {
            case 0: DropItem(new Board(70)); break;

            case 1: DropItem(new BoltOfCloth(70)); break;

            case 2: DropItem(new Bottle(70)); break;

            case 3: DropItem(new CopperWire(70)); break;

            case 4: DropItem(new Cotton(70)); break;

            case 5: DropItem(new DarkYarn(70)); break;

            case 6: DropItem(new Feather(70)); break;

            case 7: DropItem(new Flax(70)); break;

            case 8: DropItem(new Gears(70)); break;

            case 9: DropItem(new GoldWire(70)); break;

            case 10: DropItem(new IronIngot(70)); break;

            case 11: DropItem(new IronWire(70)); break;

            case 12: DropItem(new Leather(70)); break;

            case 13: DropItem(new LightYarn(70)); break;

            case 14: DropItem(new Shaft(70)); break;

            case 15: DropItem(new SilverWire(70)); break;

            case 16: DropItem(new SpoolOfThread(70)); break;

            case 17: DropItem(new Springs(70)); break;

            case 18: DropItem(new Wool(70)); break;
            }

            switch (Utility.Random(5))
            {
            case 0: DropItem(new ArcaneStone(15)); break;

            case 1: DropItem(new BeetleEgg(15)); break;

            case 2: DropItem(new DragonScale(15)); break;

            case 3: DropItem(new FishScale(15)); break;

            case 4: DropItem(new SerpentScale(15)); break;
            }

            Item ReagentLoot = Loot.RandomReagent();

            ReagentLoot.Amount = Utility.RandomMinMax(5, 10);
            DropItem(ReagentLoot);

            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new SackFlour());
            }

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

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

/////////////////////////////////////// LV 20-30
            if (Utility.RandomDouble() < 0.10)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(31))
                {
                case 0: weapon = new DoubleAxe(); break;                      // Lv20

                case 1: weapon = new TwoHandedAxe(); break;                   // Lv25

                case 2: weapon = new WarAxe(); break;                         // Lv30

                case 3: weapon = new CompositeBow(); break;                   // Lv20

                case 4: weapon = new EbonyCrossbow(); break;                  // Lv20

                case 5: weapon = new FireBow(); break;                        // Lv25

                case 6: weapon = new GrassBow(); break;                       // Lv25

                case 7: weapon = new IceBow(); break;                         // Lv25

                case 8: weapon = new LightningBow(); break;                   // Lv25

                case 9: weapon = new EbonyWarBow(); break;                    // Lv30

                case 10: weapon = new PistolCrossbow(); break;                // Lv30

                case 11: weapon = new EbonyDualDaggers(); break;              // Lv20

                case 12: weapon = new Tekagi(); break;                        // Lv25

                case 13: weapon = new ElvenSpellblade(); break;               // Lv30

                case 14: weapon = new WarMace(); break;                       // Lv20

                case 15: weapon = new Tessen(); break;                        // Lv25

                case 16: weapon = new HammerPick(); break;                    // Lv30

                case 17: weapon = new Spear(); break;                         // Lv20

                case 18: weapon = new BoneSpear(); break;                     // Lv25

                case 19: weapon = new BubbleStaff(); break;                   // Lv25

                case 20: weapon = new CrystalStaff(); break;                  // Lv25

                case 21: weapon = new EnergyStaff(); break;                   // Lv25

                case 22: weapon = new FireStaff(); break;                     // Lv25

                case 23: weapon = new VineStaff(); break;                     // Lv25

                case 24: weapon = new BlackStaff(); break;                    // Lv30

                case 25: weapon = new VikingSword(); break;                   // Lv20

                case 26: weapon = new Wakizashi(); break;                     // Lv20

                case 27: weapon = new Daisho(); break;                        // Lv30

                case 28: weapon = new EbonyScimitar(); break;                 // Lv30

                case 29: weapon = new RuneBlade(); break;                     // Lv30

                default: weapon = new Longsword(); break;                     // Lv20
                }

                BaseRunicTool.ApplyAttributesTo(weapon, 2, 5, 50);
                DropItem(weapon);
            }

/////////////////////////////////////// LV 18-27
            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                switch (Utility.Random(18))
                {
                case 0: armor = new HideFemaleChest(); break;                   // Lv18

                case 1: armor = new HideGloves(); break;                        // Lv18

                case 2: armor = new HideGorget(); break;                        // Lv18

                case 3: armor = new HidePants(); break;                         // Lv18

                case 4: armor = new HidePauldrons(); break;                     // Lv18

                case 5: armor = new StuddedDo(); break;                         // Lv21

                case 6: armor = new StuddedHaidate(); break;                    // Lv21

                case 7: armor = new StuddedHiroSode(); break;                   // Lv21

                case 8: armor = new StuddedMempo(); break;                      // Lv21

                case 9: armor = new StuddedSuneate(); break;                    // Lv21

                case 10: armor = new VikingStuddedArms(); break;                // Lv24

                case 11: armor = new VikingStuddedCap(); break;                 // Lv24

                case 12: armor = new VikingStuddedChest(); break;               // Lv24

                case 13: armor = new VikingStuddedLegs(); break;                // Lv24

                case 14: armor = new ChainChest(); break;                       // Lv27

                case 15: armor = new ChainCoif(); break;                        // Lv27

                case 16: armor = new ChainLegs(); break;                        // Lv27

                default: armor = new HideChest(); break;                        // Lv18
                }

                BaseRunicTool.ApplyAttributesTo(armor, 3, 5, 50);
                DropItem(armor);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseHat hat = Loot.RandomHat(true);
                BaseRunicTool.ApplyAttributesTo(hat, 3, 12, 15);
                DropItem(hat);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 12, 15);
                DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield1 = new Buckler();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield1, 3, 5, 50);
                }
                DropItem(shield1);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield2 = new WoodenShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield2, 3, 5, 50);
                }
                DropItem(shield2);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield3 = new AmmoniteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield3, 3, 5, 50);
                }
                DropItem(shield3);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield4 = new BronzeShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield4, 3, 5, 50);
                }
                DropItem(shield4);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield5 = new MetalShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield5, 3, 5, 50);
                }
                DropItem(shield5);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield6 = new WoodenKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield6, 3, 5, 50);
                }
                DropItem(shield6);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel bracelet = new SilverBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 3, 12, 15);
                }
                DropItem(bracelet);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 3, 12, 15);
                }
                DropItem(earrings);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel necklace = new SilverNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 12, 15);
                }
                DropItem(necklace);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 3, 12, 15);
                }
                DropItem(ring);
            }
        }
Beispiel #21
0
        public static void FillOld(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;

            cont.TrapType    = TrapType.ExplosionTrap;
            cont.TrapPower   = level * 25;
            cont.TrapLevel   = level;
            cont.TrapEnabled = true;

            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 = 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);

                    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 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)
            {
                Item item = (Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]);
                cont.DropItem(item);
            }
        }
Beispiel #22
0
        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();


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

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

                        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 = Utility.RandomMinMax(1, 5);
                        int min            = 20;
                        int max            = 80;

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

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

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

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

                    DropItem(item);
                }
                else if (item is BaseJewel)
                {
                    int attributeCount = Utility.RandomMinMax(1, 5);
                    int min            = 20;
                    int max            = 80;

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

                    DropItem(item);
                }
            }
        }
Beispiel #23
0
 public SlayerLongbow()
 {
     Slayer2 = BaseRunicTool.GetRandomSlayer();
 }
Beispiel #24
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);
            }
        }
Beispiel #25
0
            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 (Utility.Random(100) < 45)
                {
                    switch (Utility.Random(16))
                    {
                    case 0:
                        Skeleton skel = new Skeleton();
                        skel.Location  = m_From.Location;
                        skel.Map       = m_From.Map;
                        skel.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            skel.IsParagon = true;
                        }

                        World.AddMobile(skel);
                        break;

                    case 1:
                        Ghoul ghoul = new Ghoul();
                        ghoul.Location  = m_From.Location;
                        ghoul.Map       = m_From.Map;
                        ghoul.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            ghoul.IsParagon = true;
                        }

                        World.AddMobile(ghoul);
                        break;

                    case 2:
                        Wraith wraith = new Wraith();
                        wraith.Location  = m_From.Location;
                        wraith.Map       = m_From.Map;
                        wraith.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            wraith.IsParagon = true;
                        }

                        World.AddMobile(wraith);
                        break;

                    case 3:
                        Lich lich = new Lich();
                        lich.Location  = m_From.Location;
                        lich.Map       = m_From.Map;
                        lich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lich.IsParagon = true;
                        }

                        World.AddMobile(lich);
                        break;

                    case 4:
                        LichLord lichl = new LichLord();
                        lichl.Location  = m_From.Location;
                        lichl.Map       = m_From.Map;
                        lichl.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lichl.IsParagon = true;
                        }

                        World.AddMobile(lichl);
                        break;

                    case 5:
                        AncientLich alich = new AncientLich();
                        alich.Location  = m_From.Location;
                        alich.Map       = m_From.Map;
                        alich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            alich.IsParagon = true;
                        }

                        World.AddMobile(alich);
                        break;

                    case 6:
                        Mummy mum = new Mummy();
                        mum.Location  = m_From.Location;
                        mum.Map       = m_From.Map;
                        mum.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            mum.IsParagon = true;
                        }

                        World.AddMobile(mum);
                        break;

                    case 7:
                        Zombie zom = new Zombie();
                        zom.Location  = m_From.Location;
                        zom.Map       = m_From.Map;
                        zom.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            zom.IsParagon = true;
                        }

                        World.AddMobile(zom);
                        break;

                    case 8:
                        SkeletalKnight sk = new SkeletalKnight();
                        sk.Location  = m_From.Location;
                        sk.Map       = m_From.Map;
                        sk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sk.IsParagon = true;
                        }

                        World.AddMobile(sk);
                        break;

                    case 9:
                        SkeletalMage sm = new SkeletalMage();
                        sm.Location  = m_From.Location;
                        sm.Map       = m_From.Map;
                        sm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sm.IsParagon = true;
                        }

                        World.AddMobile(sm);
                        break;

                    case 10:
                        BoneKnight bk = new BoneKnight();
                        bk.Location  = m_From.Location;
                        bk.Map       = m_From.Map;
                        bk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bk.IsParagon = true;
                        }

                        World.AddMobile(bk);
                        break;

                    case 11:
                        BoneMagi bm = new BoneMagi();
                        bm.Location  = m_From.Location;
                        bm.Map       = m_From.Map;
                        bm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bm.IsParagon = true;
                        }

                        World.AddMobile(bm);
                        break;

                    case 12:
                        Spectre spec = new Spectre();
                        spec.Location  = m_From.Location;
                        spec.Map       = m_From.Map;
                        spec.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            spec.IsParagon = true;
                        }

                        World.AddMobile(spec);
                        break;

                    case 13:
                        Shade shade = new Shade();
                        shade.Location  = m_From.Location;
                        shade.Map       = m_From.Map;
                        shade.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            shade.IsParagon = true;
                        }

                        World.AddMobile(shade);
                        break;

                    case 14:
                        Bogle bog = new Bogle();
                        bog.Location  = m_From.Location;
                        bog.Map       = m_From.Map;
                        bog.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bog.IsParagon = true;
                        }

                        World.AddMobile(bog);
                        break;

                    case 15:
                        FrostDragon fDragon = new FrostDragon();
                        fDragon.PackGold(50000);
                        fDragon.Location  = m_From.Location;
                        fDragon.Map       = m_From.Map;
                        fDragon.Combatant = m_From;
                        if (Utility.Random(100) < 20)
                        {
                            fDragon.IsParagon = true;
                            fDragon.PackItem(new SoulweaponBox());
                        }
                        break;
                    }
                    m_From.SendMessage(6, "你驚醒了沉睡中的亡靈.");
                }
                else if (m_From.Skills[SkillName.Mining].Base < 15.0)
                {
                    if (Utility.Random(100) < 55)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 35.0)
                {
                    if (Utility.Random(100) < 45)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    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("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 50.0)
                {
                    if (Utility.Random(100) < 35)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    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("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 75.0)
                {
                    if (Utility.Random(100) < 25)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    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("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 90.0)
                {
                    if (Utility.Random(100) < 15)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 30);
                        reg.Amount = Utility.RandomMinMax(2, 30);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if (Utility.Random(10) < 1)//概率 zp
                    {
                        Item i;
                        switch (Utility.Random(13))
                        {
                        case 0: { i = new ArmoredNinjaBelt(); break; }

                        case 1: { i = new ButchersResolve(); break; }

                        case 2: { i = new FollowerOfTheOldLord(); break; }

                        case 3: { i = new SkirtOfTheAmazon(); break; }

                        case 4: { i = new HolyHammerOfExorcism(); break; }

                        case 5: { i = new ArmoredCloak(); break; }

                        case 6: { i = new SoulweaponBox(); break; }

                        default:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                        case 11:
                        case 12: { i = new AutoResPotion(); break; }
                        }
                        m_From.SendMessage(25, "你挖到了一些很有價值的東西.");
                        m_From.PlaySound(0x41e);
                        m_From.AddToBackpack(i);
                        m_From.SendGump(new totGump(i));
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 40);
                        reg.Amount = Utility.RandomMinMax(2, 40);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("你什麽都沒有挖掘到.");
                }

                Stop();
            }
Beispiel #26
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);
                    }
                }
            }
        }
Beispiel #27
0
        public static void ApplyReforgedProperties(Item item, ReforgedPrefix prefix, ReforgedSuffix suffix, bool playermade, int budget, int perclow, int perchigh, int maxmods, int luckchance, BaseRunicTool tool = null, ReforgingOption option = ReforgingOption.None)
        {
            if (prefix == ReforgedPrefix.None && suffix == ReforgedSuffix.None)
            {
                for (int i = 0; i < maxmods; i++)
                    ApplyRunicAttributes(item, perclow, perchigh, ref budget, i, luckchance);
                ApplyItemPower(item, playermade);
            }
            else
            {
                int prefixID = (int)prefix;
                int suffixID = (int)suffix;

                int index = GetCollectionIndex(item);
                int resIndex = -1;
                int preIndex = -1;

                if (tool != null)
                {
                    resIndex = GetResourceIndex(tool.Resource);
                    preIndex = GetPrerequisiteIndex(option);
                }

                if (index == -1)
                    return;

                List<NamedInfoCol> prefixCol = null;
                List<NamedInfoCol> suffixCol = null;

                if (prefix != ReforgedPrefix.None)
                {
                    try
                    {
                        prefixCol = new List<NamedInfoCol>();
                        prefixCol.AddRange(m_PrefixSuffixInfo[prefixID][index]);
                    }
                    catch
                    {
                        Console.WriteLine("Error: Prefix not in collection: {0}", prefixID);
                    }
                }

                if (suffix != ReforgedSuffix.None)
                {
                    if (suffixCol == null)
                        suffixCol = new List<NamedInfoCol>();

                    try
                    {
                        suffixCol.AddRange(m_PrefixSuffixInfo[suffixID][index]);
                    }
                    catch
                    {
                        Console.WriteLine("Error: Suffix not in collection: {0}", suffixID);
                    }
                }

                //Removes things like blood drinking/balanced/splintering
                CheckAttributes(item, prefixCol, playermade);
                CheckAttributes(item, suffixCol, playermade);

                int i = 0;
                int mods = 0;
                bool addedprefix = false;
                bool addedsuffix = false;

                int moddedPercLow = CalculateMinIntensity(perclow, perchigh, option);
                int moddedPercHigh = perchigh;

                if (prefix != ReforgedPrefix.None && suffix == ReforgedSuffix.None && prefixCol != null)
                {
                    int specialAdd = GetModsPer(index, prefixID, maxmods, false);

                    while (budget > 25 && mods < maxmods && i < 25)
                    {
                        if (prefixCol.Count > 0 && specialAdd > 0)
                        {
                            int random = Utility.Random(prefixCol.Count);
                            if (ApplyAttribute(item, prefixCol[random].Attribute, prefixCol[random].Min(resIndex, preIndex, item), prefixCol[random].Max(resIndex, preIndex, item), moddedPercLow, moddedPercHigh, ref budget, luckchance))
                            {
                                addedprefix = true;
                                specialAdd--;
                                mods++;
                            }

                            prefixCol.RemoveAt(random);
                        }
                        else if (ApplyRunicAttributes(item, perclow, perchigh, ref budget, i, luckchance))
                            mods++;

                        i++;
                    }

                    if (addedprefix)
                        ApplyPrefixName(item, prefix);
                }
                else if (prefix == ReforgedPrefix.None && suffix != ReforgedSuffix.None && suffixCol != null)
                {
                    int specialAdd = GetModsPer(index, suffixID, maxmods, false);

                    while (budget > 25 && mods < maxmods && i < 25)
                    {
                        if (suffixCol.Count > 0 && specialAdd > 0)
                        {
                            int random = Utility.Random(suffixCol.Count);
                            if (ApplyAttribute(item, suffixCol[random].Attribute, suffixCol[random].Min(resIndex, preIndex, item), suffixCol[random].Max(resIndex, preIndex, item), moddedPercLow, moddedPercHigh, ref budget, luckchance))
                            {
                                addedsuffix = true;
                                specialAdd--;
                                mods++;
                            }

                            suffixCol.RemoveAt(random);
                        }
                        else if (ApplyRunicAttributes(item, perclow, perchigh, ref budget, i, luckchance))
                            mods++;

                        i++;
                    }

                    if (addedsuffix)
                        ApplySuffixName(item, suffix);
                }
                else if (prefix != ReforgedPrefix.None && suffix != ReforgedSuffix.None && prefixCol != null && suffixCol != null)
                {
                    int specialAddPrefix = GetModsPer(index, prefixID, maxmods, true);
                    int specialAddSuffix = GetModsPer(index, suffixID, maxmods, true);

                    while (budget > 25 && mods < maxmods && i < 25)
                    {
                        if (prefixCol.Count > 0 && specialAddPrefix > 0)
                        {
                            int random = Utility.Random(prefixCol.Count);
                            if (ApplyAttribute(item, prefixCol[random].Attribute, prefixCol[random].Min(resIndex, preIndex, item), prefixCol[random].Max(resIndex, preIndex, item), moddedPercLow, moddedPercHigh, ref budget, luckchance))
                            {
                                addedprefix = true;
                                specialAddPrefix--;
                                mods++;
                            }

                            prefixCol.RemoveAt(random);
                        }
                        else if (suffixCol.Count > 0 && specialAddSuffix > 0)
                        {
                            int random = Utility.Random(suffixCol.Count);
                            if (ApplyAttribute(item, suffixCol[random].Attribute, suffixCol[random].Min(resIndex, preIndex, item), suffixCol[random].Max(resIndex, preIndex, item), moddedPercLow, moddedPercHigh, ref budget, luckchance))
                            {
                                addedsuffix = true;
                                specialAddSuffix--;
                                mods++;
                            }

                            suffixCol.RemoveAt(random);
                        }
                        else if (ApplyRunicAttributes(item, perclow, perchigh, ref budget, i, luckchance))
                            mods++;

                        i++;
                    }

                    if (addedprefix)
                        ApplyPrefixName(item, prefix);

                    if (addedsuffix)
                        ApplySuffixName(item, suffix);
                }

                ApplyItemPower(item, playermade);
            }
        }
Beispiel #28
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();
        }
Beispiel #29
0
        public FortressCalcifinaTreasureChest1() : base(0xE43)
        {
            Name    = "a treasure chest -25-";
            Movable = true;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 25;
            LockLevel     = 25;
            MaxLockLevel  = 30;

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

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

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

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

            Item ReagentLoot = Loot.RandomReagent();

            ReagentLoot.Amount = Utility.Random(15, 20);
            DropItem(ReagentLoot);

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

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

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

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

            Item PotionLoot = Loot.RandomPotion();

            DropItem(PotionLoot);

/////////////////////////////////////// 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, 4, 18, 22);

                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, 4, 18, 22);

                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, 4, 18, 22);

                DropItem(hat);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 4, 18, 22);

                DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseShield shield = new MetalKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield, 4, 18, 22);
                }

                DropItem(shield);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel bracelet = new GoldBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 4, 18, 22);
                }

                DropItem(bracelet);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 4, 18, 22);
                }

                DropItem(earrings);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel necklace = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 4, 18, 22);
                }

                DropItem(necklace);
            }

            if (Utility.RandomDouble() < 0.15)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 4, 18, 22);
                }

                DropItem(ring);
            }
        }
Beispiel #30
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;
            int numberItems;

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

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

                if (Utility.RandomDouble() < 0.75)
                {
                    cont.DropItem(new TreasureMap(0, Map.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);
            }
        }
Beispiel #31
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                Mobile from = sender.Mobile;

                if (m_Artifact.PaganPoints < 1)
                {
                    m_Artifact.PaganPoints = Utility.RandomMinMax(80, 100);
                }

                from.SendSound(0x2C);

                if (info.ButtonID == 1)
                {
                    if (
                        m_Artifact.PaganItem == 0x1408 ||
                        m_Artifact.PaganItem == 0x140A ||
                        m_Artifact.PaganItem == 0x140C ||
                        m_Artifact.PaganItem == 0x1412 ||
                        m_Artifact.PaganItem == 0x2645 ||
                        m_Artifact.PaganItem == 0x2FBB ||
                        m_Artifact.PaganItem == 0x140E ||
                        m_Artifact.PaganItem == 0x1410 ||
                        m_Artifact.PaganItem == 0x1411 ||
                        m_Artifact.PaganItem == 0x1413 ||
                        m_Artifact.PaganItem == 0x1414 ||
                        m_Artifact.PaganItem == 0x1415
                        )
                    {
                        BaseGiftArmor armor = new GiftPlateHelm();
                        armor.Delete();

                        if (m_Artifact.PaganItem == 0x1410)
                        {
                            armor = new GiftPlateArms();
                        }
                        else if (m_Artifact.PaganItem == 0x1411)
                        {
                            armor = new GiftPlateLegs();
                        }
                        else if (m_Artifact.PaganItem == 0x1413)
                        {
                            armor = new GiftPlateGorget();
                        }
                        else if (m_Artifact.PaganItem == 0x1414)
                        {
                            armor = new GiftPlateGloves();
                        }
                        else if (m_Artifact.PaganItem == 0x1415)
                        {
                            armor = new GiftPlateChest();
                        }
                        else
                        {
                            armor = new GiftPlateHelm(); armor.ItemID = m_Artifact.PaganItem;
                        }

                        armor.Name     = m_Artifact.PaganName;
                        armor.Hue      = m_Artifact.PaganColor;
                        armor.m_Owner  = from;
                        armor.m_Gifter = "Artifact from Pagan";
                        armor.m_How    = "Found by";
                        armor.m_Points = m_Artifact.PaganPoints;

                        from.AddToBackpack(armor);
                        from.SendMessage("You take possession of the Pagan artifact, " + m_Artifact.PaganName + "!");
                        LoggingFunctions.LogGeneric(from, "has found a Pagan armor artifact.");
                    }
                    else if (m_Artifact.PaganItem == 0x1BC4 || m_Artifact.PaganItem == 0x1BC3)
                    {
                        BaseGiftShield shield = new GiftOrderShield();

                        if (m_Artifact.PaganItem == 0x1BC3)
                        {
                            shield.Delete(); shield = new GiftChaosShield();
                        }

                        shield.Name     = m_Artifact.PaganName;
                        shield.Hue      = m_Artifact.PaganColor;
                        shield.m_Owner  = from;
                        shield.m_Gifter = "Artifact from Pagan";
                        shield.m_How    = "Found by";
                        shield.m_Points = m_Artifact.PaganPoints;

                        from.AddToBackpack(shield);
                        from.SendMessage("You take possession of the Pagan artifact, " + m_Artifact.PaganName + "!");
                        LoggingFunctions.LogGeneric(from, "has found a Pagan shield artifact.");
                    }
                    else if (m_Artifact.PaganItem == 0x1406 || m_Artifact.PaganItem == 0xF5D)
                    {
                        BaseGiftBashing mace = new GiftWarMace();

                        if (m_Artifact.PaganItem == 0x1BC3)
                        {
                            mace.Delete(); mace = new GiftMace(); mace.Slayer = SlayerName.Silver;
                        }
                        else
                        {
                            SlayerName slayer1 = BaseRunicTool.GetRandomSlayer();
                            mace.Slayer = slayer1;
                            SlayerName slayer2 = BaseRunicTool.GetRandomSlayer();

                            while (slayer1 == slayer2)
                            {
                                slayer2 = BaseRunicTool.GetRandomSlayer();
                            }
                            mace.Slayer2 = slayer2;
                        }
                        mace.Name     = m_Artifact.PaganName;
                        mace.Hue      = m_Artifact.PaganColor;
                        mace.m_Owner  = from;
                        mace.m_Gifter = "Artifact from Pagan";
                        mace.m_How    = "Found by";
                        mace.m_Points = m_Artifact.PaganPoints;

                        from.AddToBackpack(mace);
                        from.SendMessage("You take possession of the Pagan artifact, " + m_Artifact.PaganName + "!");
                        LoggingFunctions.LogGeneric(from, "has found a Pagan weapon artifact.");
                    }
                    else if (m_Artifact.PaganItem == 0x2D2C)
                    {
                        BaseGiftKnife dagger = new GiftDagger();

                        dagger.ItemID   = m_Artifact.PaganItem;
                        dagger.Name     = m_Artifact.PaganName;
                        dagger.Hue      = m_Artifact.PaganColor;
                        dagger.m_Owner  = from;
                        dagger.m_Gifter = "Artifact from Pagan";
                        dagger.m_How    = "Found by";
                        dagger.m_Points = m_Artifact.PaganPoints;
                        dagger.SkillBonuses.SetValues(0, SkillName.Poisoning, Utility.RandomMinMax(15, 30));

                        from.AddToBackpack(dagger);
                        from.SendMessage("You take possession of the Pagan artifact, " + m_Artifact.PaganName + "!");
                        LoggingFunctions.LogGeneric(from, "has found a Pagan weapon artifact.");
                    }
                    else if (m_Artifact.PaganItem == 0x13FA)
                    {
                        BaseGiftAxe axe = new GiftLargeBattleAxe();

                        axe.ItemID   = m_Artifact.PaganItem;
                        axe.Name     = m_Artifact.PaganName;
                        axe.Hue      = m_Artifact.PaganColor;
                        axe.m_Owner  = from;
                        axe.m_Gifter = "Artifact from Pagan";
                        axe.m_How    = "Found by";
                        axe.m_Points = m_Artifact.PaganPoints;
                        axe.SkillBonuses.SetValues(0, SkillName.Swords, Utility.RandomMinMax(15, 30));

                        from.AddToBackpack(axe);
                        from.SendMessage("You take possession of the Pagan artifact, " + m_Artifact.PaganName + "!");
                        LoggingFunctions.LogGeneric(from, "has found a Pagan weapon artifact.");
                    }
                    else
                    {
                        BaseGiftSword sword = new GiftLongsword();
                        sword.Delete();

                        if (m_Artifact.PaganItem == 0x1400)
                        {
                            sword = new GiftKryss(); sword.Slayer = SlayerName.FlameDousing; if (Utility.RandomMinMax(1, 4) == 1)
                            {
                                sword.Slayer = SlayerName.Exorcism;
                            }
                        }
                        else if (m_Artifact.PaganItem == 0xF5F)
                        {
                            sword = new GiftBroadsword(); sword.SkillBonuses.SetValues(0, SkillName.MagicResist, Utility.RandomMinMax(15, 30));
                        }
                        else if (m_Artifact.PaganItem == 0xF60)
                        {
                            sword = new GiftLongsword(); sword.SkillBonuses.SetValues(0, SkillName.Tactics, Utility.RandomMinMax(15, 30));
                        }
                        else
                        {
                            sword = new GiftScimitar(); sword.Slayer = SlayerName.Silver;
                        }

                        sword.Name     = m_Artifact.PaganName;
                        sword.Hue      = m_Artifact.PaganColor;
                        sword.m_Owner  = from;
                        sword.m_Gifter = "Artifact from Pagan";
                        sword.m_How    = "Found by";
                        sword.m_Points = m_Artifact.PaganPoints;

                        from.AddToBackpack(sword);
                        from.SendMessage("You take possession of the Pagan artifact, " + m_Artifact.PaganName + "!");
                        LoggingFunctions.LogGeneric(from, "has found a Pagan weapon artifact.");
                    }

                    m_Artifact.Delete();
                }
            }
Beispiel #32
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 BleakWindTunnelsChest1() : base(0xE43)
        {
            Name    = "a treasure chest -50-";
            Hue     = 1151;
            Movable = true;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 50;
            LockLevel     = 50;
            MaxLockLevel  = 80;

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

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

            Item GemLoot = Loot.RandomGem();

            DropItem(GemLoot);

/////////////////////////////////////// Recipe Scrolls
/////////////////////////////////// Ingredients
            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new BagOfSugarRecipe(5001));
            }

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

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

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

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

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new SweetDoughRecipe(5003));
            }
/////////////////////////////////// Random
            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new RandomBakingRecipe(Utility.RandomMinMax(5501, 5550)));
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new RandomBoilingRecipe(Utility.RandomMinMax(5601, 5626)));
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new RandomIngredientsRecipe(Utility.RandomMinMax(5000, 5005)));
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new RandomOilsRecipe(Utility.RandomMinMax(5101, 5105)));
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new RandomPreparationsRecipe(Utility.RandomMinMax(5401, 5435)));
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new RandomRawMeatPrepRecipe(Utility.RandomMinMax(5301, 5342)));
            }

            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new RandomSaucesRecipe(Utility.RandomMinMax(5201, 5208)));
            }
/////////////////////////////////// Misc
            if (Utility.RandomDouble() < 0.10)
            {
                DropItem(new HarpyEggSoupRecipe(5019));
            }

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

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

            switch (Utility.Random(19))
            {
            case 0: DropItem(new Board(90)); break;

            case 1: DropItem(new BoltOfCloth(90)); break;

            case 2: DropItem(new Bottle(90)); break;

            case 3: DropItem(new CopperWire(90)); break;

            case 4: DropItem(new Cotton(90)); break;

            case 5: DropItem(new DarkYarn(90)); break;

            case 6: DropItem(new Feather(90)); break;

            case 7: DropItem(new Flax(90)); break;

            case 8: DropItem(new Gears(90)); break;

            case 9: DropItem(new GoldWire(90)); break;

            case 10: DropItem(new IronIngot(90)); break;

            case 11: DropItem(new IronWire(90)); break;

            case 12: DropItem(new Leather(90)); break;

            case 13: DropItem(new LightYarn(90)); break;

            case 14: DropItem(new Shaft(90)); break;

            case 15: DropItem(new SilverWire(90)); break;

            case 16: DropItem(new SpoolOfThread(90)); break;

            case 17: DropItem(new Springs(90)); break;

            case 18: DropItem(new Wool(90)); break;
            }

            switch (Utility.Random(5))
            {
            case 0: DropItem(new ArcaneStone(25)); break;

            case 1: DropItem(new DiamondDust(25)); break;

            case 2: DropItem(new ElementalDust(25)); break;

            case 3: DropItem(new SpiderEgg(25)); break;

            case 4: DropItem(new ThunderStone(25)); break;
            }

            Item ReagentLoot = Loot.RandomReagent();

            ReagentLoot.Amount = 50;
            DropItem(ReagentLoot);

            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new SackFlour());
            }

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

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

            if (Utility.RandomDouble() < 0.05)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                BaseRunicTool.ApplyAttributesTo(weapon, 2, 5, 10);
                weapon.Hue = 1151;
                weapon.WeaponAttributes.HitHarm = 5;
                DropItem(weapon);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor, 2, 5, 10);
                armor.Hue       = 1151;
                armor.ColdBonus = 10;
                DropItem(armor);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseHat hat = Loot.RandomHat(true);
                BaseRunicTool.ApplyAttributesTo(hat, 2, 5, 10);
                hat.Hue = 1151;
                hat.Resistances.Cold = 10;
                DropItem(hat);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 2, 5, 10);
                clothing.Hue = 1151;
                clothing.Resistances.Cold = 10;
                DropItem(clothing);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield = new MercenaryShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield, 2, 5, 10);
                }
                shield.Hue       = 1151;
                shield.ColdBonus = 10;
                DropItem(shield);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel bracelet = new SilverBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 2, 5, 10);
                }
                bracelet.Hue = 1151;
                bracelet.Resistances.Cold = 10;
                DropItem(bracelet);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 2, 5, 10);
                }
                earrings.Hue = 1151;
                earrings.Resistances.Cold = 10;
                DropItem(earrings);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel necklace = new SilverNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 2, 5, 10);
                }
                necklace.Hue = 1151;
                necklace.Resistances.Cold = 10;
                DropItem(necklace);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 2, 5, 10);
                }
                ring.Hue = 1151;
                ring.Resistances.Cold = 10;
                DropItem(ring);
            }
        }
            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();
            }
Beispiel #35
0
        public MongbatHideoutTreasureChest1() : base(0xE43)
        {
            Name    = "a treasure chest -40-";
            Movable = true;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 40;
            LockLevel     = 40;
            MaxLockLevel  = 80;

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

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

            switch (Utility.Random(19))
            {
            case 0: DropItem(new Board(60)); break;

            case 1: DropItem(new BoltOfCloth(60)); break;

            case 2: DropItem(new Bottle(60)); break;

            case 3: DropItem(new CopperWire(60)); break;

            case 4: DropItem(new Cotton(60)); break;

            case 5: DropItem(new DarkYarn(60)); break;

            case 6: DropItem(new Feather(60)); break;

            case 7: DropItem(new Flax(60)); break;

            case 8: DropItem(new Gears(60)); break;

            case 9: DropItem(new GoldWire(60)); break;

            case 10: DropItem(new IronIngot(60)); break;

            case 11: DropItem(new IronWire(60)); break;

            case 12: DropItem(new Leather(60)); break;

            case 13: DropItem(new LightYarn(60)); break;

            case 14: DropItem(new Shaft(60)); break;

            case 15: DropItem(new SilverWire(60)); break;

            case 16: DropItem(new SpoolOfThread(60)); break;

            case 17: DropItem(new Springs(60)); break;

            case 18: DropItem(new Wool(60)); break;
            }

            switch (Utility.Random(5))
            {
            case 0: DropItem(new BeetleEgg(15)); break;

            case 1: DropItem(new FishScale(15)); break;

            case 2: DropItem(new Nirnroot(15)); break;

            case 3: DropItem(new SerpentScale(15)); break;

            case 4: DropItem(new ThunderStone(15)); break;
            }

            Item ReagentLoot = Loot.RandomReagent();

            ReagentLoot.Amount = Utility.RandomMinMax(5, 10);
            DropItem(ReagentLoot);

            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new SackFlour());
            }

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

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

/////////////////////////////////////// LV 1-15
            if (Utility.RandomDouble() < 0.10)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(36))
                {
                case 0: weapon = new Hatchet(); break;                     // Lv1

                case 1: weapon = new Axe(); break;                         // Lv5

                case 2: weapon = new BattleAxe(); break;                   // Lv10

                case 3: weapon = new Bow(); break;                         // Lv1

                case 4: weapon = new Crossbow(); break;                    // Lv1

                case 5: weapon = new Balestra(); break;                    // Lv5

                case 6: weapon = new ElvenLeafBow(); break;                // Lv5

                case 7: weapon = new MagicalShortbow(); break;             // Lv10

                case 8: weapon = new RepeatingCrossbow(); break;           // Lv10

                case 9: weapon = new SkinningKnife(); break;               // Lv1

                case 10: weapon = new Cleaver(); break;                    // Lv5

                case 11: weapon = new Dagger(); break;                     // Lv5

                case 12: weapon = new ButcherKnife(); break;               // Lv10

                case 13: weapon = new EbonyDagger(); break;                // Lv10

                case 14: weapon = new Sai(); break;                        // Lv15

                case 15: weapon = new Club(); break;                       // Lv1

                case 16: weapon = new Nunchaku(); break;                   // Lv1

                case 17: weapon = new Mace(); break;                       // Lv5

                case 18: weapon = new Maul(); break;                       // Lv10

                case 19: weapon = new Scepter(); break;                    // Lv15

                case 20: weapon = new Pitchfork(); break;                  // Lv1

                case 21: weapon = new ShortSpear(); break;                 // Lv5

                case 22: weapon = new Pilum(); break;                      // Lv10

                case 23: weapon = new Pike(); break;                       // Lv15

                case 24: weapon = new GnarledStaff(); break;               // Lv1

                case 25: weapon = new ShepherdsCrook(); break;             // Lv1

                case 26: weapon = new QuarterStaff(); break;               // Lv10

                case 27: weapon = new ReptilianStaff(); break;             // Lv15

                case 28: weapon = new Bokuto(); break;                     // Lv1

                case 29: weapon = new BoneHarvester(); break;              // Lv1

                case 30: weapon = new Cutlass(); break;                    // Lv1

                case 31: weapon = new ElvenMachete(); break;               // Lv1

                case 32: weapon = new Kryss(); break;                      // Lv1

                case 33: weapon = new EbonyRapier(); break;                // Lv10

                case 34: weapon = new Scimitar(); break;                   // Lv10

                default: weapon = new Leafblade(); break;                  // Lv1
                }

                switch (Utility.Random(14))
                {
                case 0: weapon.Attributes.AttackChance = Utility.RandomMinMax(1, 5); break;

                case 1: weapon.Attributes.DefendChance = Utility.RandomMinMax(1, 5); break;

                case 2: weapon.Attributes.Luck = Utility.RandomMinMax(1, 10); break;

                case 3: weapon.Attributes.WeaponSpeed = Utility.RandomMinMax(1, 25); break;

                case 4: weapon.WeaponAttributes.HitDispel = Utility.RandomMinMax(2, 10); break;

                case 5: weapon.WeaponAttributes.HitFireball = Utility.RandomMinMax(2, 10); break;

                case 6: weapon.WeaponAttributes.HitHarm = Utility.RandomMinMax(2, 10); break;

                case 7: weapon.WeaponAttributes.HitLeechHits = Utility.RandomMinMax(2, 10); break;

                case 8: weapon.WeaponAttributes.HitLeechMana = Utility.RandomMinMax(2, 10); break;

                case 9: weapon.WeaponAttributes.HitLeechStam = Utility.RandomMinMax(2, 10); break;

                case 10: weapon.WeaponAttributes.HitLightning = Utility.RandomMinMax(2, 10); break;

                case 11: weapon.WeaponAttributes.HitLowerAttack = Utility.RandomMinMax(2, 10); break;

                case 12: weapon.WeaponAttributes.HitLowerDefend = Utility.RandomMinMax(2, 10); break;

                default: weapon.Attributes.WeaponDamage = Utility.RandomMinMax(1, 10); break;
                }

                DropItem(weapon);
            }

/////////////////////////////////////// LV 1-15
            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                switch (Utility.Random(39))
                {
                case 0: armor = new LeatherArms(); break;                       // Lv1

                case 1: armor = new LeatherBustierArms(); break;                // Lv1

                case 2: armor = new LeatherCap(); break;                        // Lv1

                case 3: armor = new LeatherChest(); break;                      // Lv1

                case 4: armor = new LeatherGloves(); break;                     // Lv1

                case 5: armor = new LeatherGorget(); break;                     // Lv1

                case 6: armor = new LeatherLegs(); break;                       // Lv1

                case 7: armor = new LeatherShorts(); break;                     // Lv1

                case 8: armor = new LeatherSkirt(); break;                      // Lv1

                case 9: armor = new FemaleLeafChest(); break;                   // Lv1

                case 10: armor = new LeafArms(); break;                         // Lv3

                case 11: armor = new LeafChest(); break;                        // Lv3

                case 12: armor = new LeafGloves(); break;                       // Lv3

                case 13: armor = new LeafGorget(); break;                       // Lv3

                case 14: armor = new LeafLegs(); break;                         // Lv3

                case 15: armor = new LeafTonlet(); break;                       // Lv3

                case 16: armor = new LeatherDo(); break;                        // Lv6

                case 17: armor = new LeatherHaidate(); break;                   // Lv6

                case 18: armor = new LeatherHiroSode(); break;                  // Lv6

                case 19: armor = new LeatherJingasa(); break;                   // Lv6

                case 20: armor = new LeatherMempo(); break;                     // Lv6

                case 21: armor = new LeatherNinjaHood(); break;                 // Lv6

                case 22: armor = new LeatherNinjaJacket(); break;               // Lv6

                case 23: armor = new LeatherNinjaMitts(); break;                // Lv6

                case 24: armor = new LeatherNinjaPants(); break;                // Lv6

                case 25: armor = new LeatherSuneate(); break;                   // Lv6

                case 26: armor = new EbonsilkArms(); break;                     // Lv9

                case 27: armor = new EbonsilkChest(); break;                    // Lv9

                case 28: armor = new EbonsilkGloves(); break;                   // Lv9

                case 29: armor = new EbonsilkGorget(); break;                   // Lv9

                case 30: armor = new EbonsilkLegs(); break;                     // Lv9

                case 31: armor = new EbonsilkTiara(); break;                    // Lv9

                case 32: armor = new ChitinArms(); break;                       // Lv12

                case 33: armor = new ChitinChest(); break;                      // Lv12

                case 34: armor = new ChitinGloves(); break;                     // Lv12

                case 35: armor = new ChitinGorget(); break;                     // Lv12

                case 36: armor = new ChitinHelmet(); break;                     // Lv12

                case 37: armor = new ChitinLegs(); break;                       // Lv12

                default: armor = new FemaleLeatherChest(); break;               // Lv1
                }

                BaseRunicTool.ApplyAttributesTo(armor, 3, 5, 50);
                DropItem(armor);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseHat hat = Loot.RandomHat(true);
                BaseRunicTool.ApplyAttributesTo(hat, 3, 5, 10);
                DropItem(hat);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 5, 10);
                DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield1 = new Buckler();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield1, 3, 5, 50);
                }
                DropItem(shield1);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield2 = new WoodenShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield2, 3, 5, 50);
                }
                DropItem(shield2);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield3 = new AmmoniteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield3, 3, 5, 50);
                }
                DropItem(shield3);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield4 = new BronzeShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield4, 3, 5, 50);
                }
                DropItem(shield4);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield5 = new MetalShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield5, 3, 5, 50);
                }
                DropItem(shield5);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield6 = new WoodenKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield6, 3, 5, 50);
                }
                DropItem(shield6);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel bracelet = new SilverBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 3, 5, 10);
                }
                DropItem(bracelet);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 3, 5, 10);
                }
                DropItem(earrings);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel necklace = new SilverNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 5, 10);
                }
                DropItem(necklace);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 3, 5, 10);
                }
                DropItem(ring);
            }
        }
Beispiel #36
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;
                int   minIntensity;
                int   maxIntensity;

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

                    minIntensity = 55;
                    maxIntensity = 75;
                }
                else if (magery >= 900)
                {
                    propertyCounts = m_MasterPropertyCounts;
                    minIntensity   = 25;
                    maxIntensity   = 45;
                }
                else
                {
                    propertyCounts = m_AdeptPropertyCounts;
                    minIntensity   = 0;
                    maxIntensity   = 15;
                }

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

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

            if (makersMark)
            {
                Crafter = from;
            }

            m_Quality = (BookQuality)(quality - 1);

            return(quality);
        }
Beispiel #37
0
        public MongbatHideoutTreasureChest2() : base(0xE43)
        {
            Name    = "a treasure chest -50-";
            Movable = true;
            Weight  = 1000.0;

            TrapPower = 0;
            Locked    = true;

            RequiredSkill = 50;
            LockLevel     = 50;
            MaxLockLevel  = 80;

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

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

            switch (Utility.Random(18))
            {
            case 0: DropItem(new Board(70)); break;

            case 1: DropItem(new BoltOfCloth(70)); break;

            case 2: DropItem(new Bottle(70)); break;

            case 3: DropItem(new CopperWire(70)); break;

            case 4: DropItem(new Cotton(70)); break;

            case 5: DropItem(new DarkYarn(70)); break;

            case 6: DropItem(new Feather(70)); break;

            case 7: DropItem(new Flax(70)); break;

            case 8: DropItem(new Gears(70)); break;

            case 9: DropItem(new GoldWire(70)); break;

            case 10: DropItem(new IronIngot(70)); break;

            case 11: DropItem(new IronWire(70)); break;

            case 12: DropItem(new Leather(70)); break;

            case 13: DropItem(new LightYarn(70)); break;

            case 14: DropItem(new Shaft(70)); break;

            case 15: DropItem(new SilverWire(70)); break;

            case 16: DropItem(new SpoolOfThread(70)); break;

            case 17: DropItem(new Springs(70)); break;

            case 18: DropItem(new Wool(70)); break;
            }

            switch (Utility.Random(5))
            {
            case 0: DropItem(new BeetleEgg(25)); break;

            case 1: DropItem(new FishScale(25)); break;

            case 2: DropItem(new Nirnroot(25)); break;

            case 3: DropItem(new SerpentScale(25)); break;

            case 4: DropItem(new ThunderStone(25)); break;
            }

            Item ReagentLoot = Loot.RandomReagent();

            ReagentLoot.Amount = Utility.RandomMinMax(10, 15);
            DropItem(ReagentLoot);

            if (Utility.RandomDouble() < 0.05)
            {
                DropItem(new SackFlour());
            }

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

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

/////////////////////////////////////// LV 10-20
/////////////////////////////////////// LV 10-25 for staves
            if (Utility.RandomDouble() < 0.10)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(28))
                {
                case 0: weapon = new BattleAxe(); break;                   // Lv10

                case 1: weapon = new DoubleAxe(); break;                   // Lv20

                case 2: weapon = new MagicalShortbow(); break;             // Lv10

                case 3: weapon = new RepeatingCrossbow(); break;           // Lv10

                case 4: weapon = new ButcherKnife(); break;                // Lv10

                case 5: weapon = new CompositeBow(); break;                // Lv20

                case 6: weapon = new EbonyCrossbow(); break;               // Lv20

                case 7: weapon = new EbonyDagger(); break;                 // Lv10

                case 8: weapon = new Sai(); break;                         // Lv15

                case 9: weapon = new EbonyDualDaggers(); break;            // Lv20

                case 10: weapon = new Maul(); break;                       // Lv10

                case 11: weapon = new Scepter(); break;                    // Lv15

                case 12: weapon = new WarMace(); break;                    // Lv20

                case 13: weapon = new Pilum(); break;                      // Lv10

                case 14: weapon = new Pike(); break;                       // Lv15

                case 15: weapon = new Spear(); break;                      // Lv20

                case 16: weapon = new QuarterStaff(); break;               // Lv10

                case 17: weapon = new ReptilianStaff(); break;             // Lv15

                case 18: weapon = new BubbleStaff(); break;                // Lv25

                case 19: weapon = new CrystalStaff(); break;               // Lv25

                case 20: weapon = new EnergyStaff(); break;                // Lv25

                case 21: weapon = new FireStaff(); break;                  // Lv25

                case 22: weapon = new VineStaff(); break;                  // Lv25

                case 23: weapon = new EbonyRapier(); break;                // Lv10

                case 24: weapon = new Scimitar(); break;                   // Lv10

                case 25: weapon = new Longsword(); break;                  // Lv20

                case 26: weapon = new VikingSword(); break;                // Lv20

                default: weapon = new Wakizashi(); break;                  // Lv20
                }

                switch (Utility.Random(14))
                {
                case 0: weapon.Attributes.AttackChance = Utility.RandomMinMax(1, 5); break;

                case 1: weapon.Attributes.DefendChance = Utility.RandomMinMax(1, 5); break;

                case 2: weapon.Attributes.Luck = Utility.RandomMinMax(1, 10); break;

                case 3: weapon.Attributes.WeaponSpeed = Utility.RandomMinMax(1, 25); break;

                case 4: weapon.WeaponAttributes.HitDispel = Utility.RandomMinMax(2, 10); break;

                case 5: weapon.WeaponAttributes.HitFireball = Utility.RandomMinMax(2, 10); break;

                case 6: weapon.WeaponAttributes.HitHarm = Utility.RandomMinMax(2, 10); break;

                case 7: weapon.WeaponAttributes.HitLeechHits = Utility.RandomMinMax(2, 10); break;

                case 8: weapon.WeaponAttributes.HitLeechMana = Utility.RandomMinMax(2, 10); break;

                case 9: weapon.WeaponAttributes.HitLeechStam = Utility.RandomMinMax(2, 10); break;

                case 10: weapon.WeaponAttributes.HitLightning = Utility.RandomMinMax(2, 10); break;

                case 11: weapon.WeaponAttributes.HitLowerAttack = Utility.RandomMinMax(2, 10); break;

                case 12: weapon.WeaponAttributes.HitLowerDefend = Utility.RandomMinMax(2, 10); break;

                default: weapon.Attributes.WeaponDamage = Utility.RandomMinMax(1, 10); break;
                }

                switch (Utility.Random(14))
                {
                case 0: weapon.Attributes.AttackChance = Utility.RandomMinMax(1, 5); break;

                case 1: weapon.Attributes.DefendChance = Utility.RandomMinMax(1, 5); break;

                case 2: weapon.Attributes.Luck = Utility.RandomMinMax(1, 10); break;

                case 3: weapon.Attributes.WeaponSpeed = Utility.RandomMinMax(1, 25); break;

                case 4: weapon.WeaponAttributes.HitDispel = Utility.RandomMinMax(2, 10); break;

                case 5: weapon.WeaponAttributes.HitFireball = Utility.RandomMinMax(2, 10); break;

                case 6: weapon.WeaponAttributes.HitHarm = Utility.RandomMinMax(2, 10); break;

                case 7: weapon.WeaponAttributes.HitLeechHits = Utility.RandomMinMax(2, 10); break;

                case 8: weapon.WeaponAttributes.HitLeechMana = Utility.RandomMinMax(2, 10); break;

                case 9: weapon.WeaponAttributes.HitLeechStam = Utility.RandomMinMax(2, 10); break;

                case 10: weapon.WeaponAttributes.HitLightning = Utility.RandomMinMax(2, 10); break;

                case 11: weapon.WeaponAttributes.HitLowerAttack = Utility.RandomMinMax(2, 10); break;

                case 12: weapon.WeaponAttributes.HitLowerDefend = Utility.RandomMinMax(2, 10); break;

                default: weapon.Attributes.WeaponDamage = Utility.RandomMinMax(1, 10); break;
                }

                DropItem(weapon);
            }

/////////////////////////////////////// LV 12-18
            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                switch (Utility.Random(19))
                {
                case 0: armor = new ChitinArms(); break;                         // Lv12

                case 1: armor = new ChitinChest(); break;                        // Lv12

                case 2: armor = new ChitinGloves(); break;                       // Lv12

                case 3: armor = new ChitinGorget(); break;                       // Lv12

                case 4: armor = new ChitinHelmet(); break;                       // Lv12

                case 5: armor = new ChitinLegs(); break;                         // Lv12

                case 6: armor = new FemaleStuddedChest(); break;                 // Lv15

                case 7: armor = new StuddedArms(); break;                        // Lv15

                case 8: armor = new StuddedBustierArms(); break;                 // Lv15

                case 9: armor = new StuddedChest(); break;                       // Lv15

                case 10: armor = new StuddedGloves(); break;                     // Lv15

                case 11: armor = new StuddedGorget(); break;                     // Lv15

                case 12: armor = new StuddedLegs(); break;                       // Lv15

                case 13: armor = new HideFemaleChest(); break;                   // Lv18

                case 14: armor = new HideGloves(); break;                        // Lv18

                case 15: armor = new HideGorget(); break;                        // Lv18

                case 16: armor = new HidePants(); break;                         // Lv18

                case 17: armor = new HidePauldrons(); break;                     // Lv18

                default: armor = new HideChest(); break;                         // Lv18
                }

                BaseRunicTool.ApplyAttributesTo(armor, 3, 5, 50);
                DropItem(armor);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseHat hat = Loot.RandomHat(true);
                BaseRunicTool.ApplyAttributesTo(hat, 3, 5, 10);
                DropItem(hat);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 5, 10);
                DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield1 = new MetalShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield1, 3, 5, 50);
                }
                DropItem(shield1);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield2 = new WoodenKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield2, 3, 5, 50);
                }
                DropItem(shield2);
            }
            if (Utility.RandomDouble() < 0.05)
            {
                BaseShield shield3 = new MetalKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield3, 3, 5, 50);
                }
                DropItem(shield3);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel bracelet = new SilverBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 3, 5, 10);
                }
                DropItem(bracelet);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel earrings = new SilverEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 3, 5, 10);
                }
                DropItem(earrings);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel necklace = new SilverNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 5, 10);
                }
                DropItem(necklace);
            }
            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel ring = new SilverRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 3, 5, 10);
                }
                DropItem(ring);
            }
        }