コード例 #1
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();

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

                if (item is BaseWeapon)
                {
                    BaseWeapon weapon      = (BaseWeapon)item;
                    int        damageLevel = Utility.Random(6);
                    if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel)
                    {
                        if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls)
                        {
                            DropItem(PuzzleChest.CreateRandomSkillScroll());
                        }
                        int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn);
                        if (platAmount > 0)
                        {
                            DropItem(new Platinum(platAmount));
                        }
                        damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                    }
                    weapon.DamageLevel     = (WeaponDamageLevel)damageLevel;
                    weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                    weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                }
                else if (item is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)item;

                    armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                    armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                }
                DropItem(item);
            }
        }
コード例 #2
0
			public PuzzleGump( Mobile from, PuzzleChest chest, PuzzleChestSolution solution, int check ) : base( 50, 50 )
			{
				m_From = from;
				m_Chest = chest;
				m_Solution = solution;

				Dragable = false;

				AddBackground( 25, 0, 500, 410, 0x53 );

				AddImage( 62, 20, 0x67 );

				AddHtmlLocalized( 80, 36, 110, 70, 1018309, true, false ); // A Puzzle Lock

				/* Correctly choose the sequence of cylinders needed to open the latch.  Each cylinder
				 * may potentially be used more than once.  Beware!  A false attempt could be deadly!
				 */
				AddHtmlLocalized( 214, 26, 270, 90, 1018310, true, true );

				AddLeftCylinderButton( 62, 130, PuzzleChestCylinder.LightBlue, 10 );
				AddLeftCylinderButton( 62, 180, PuzzleChestCylinder.Blue, 11 );
				AddLeftCylinderButton( 62, 230, PuzzleChestCylinder.Green, 12 );
				AddLeftCylinderButton( 62, 280, PuzzleChestCylinder.Orange, 13 );

				AddRightCylinderButton( 451, 130, PuzzleChestCylinder.Purple, 14 );
				AddRightCylinderButton( 451, 180, PuzzleChestCylinder.Red, 15 );
				AddRightCylinderButton( 451, 230, PuzzleChestCylinder.DarkBlue, 16 );
				AddRightCylinderButton( 451, 280, PuzzleChestCylinder.Yellow, 17 );

				double lockpicking = from.Skills.Lockpicking.Base;
				if ( lockpicking >= 60.0 )
				{
					AddHtmlLocalized( 160, 125, 230, 24, 1018308, false, false ); // Lockpicking hint:

					AddBackground( 159, 150, 230, 95, 0x13EC );

					if ( lockpicking >= 80.0 )
					{
						AddHtmlLocalized( 165, 157, 200, 40, 1018312, false, false ); // In the first slot:
						AddCylinder( 350, 165, chest.Solution.First );

						AddHtmlLocalized( 165, 197, 200, 40, 1018313, false, false ); // Used in unknown slot:
						AddCylinder( 350, 200, chest.FirstHint );

						if ( lockpicking >= 90.0 )
							AddCylinder( 350, 212, chest.SecondHint );

						if ( lockpicking >= 100.0 )
							AddCylinder( 350, 224, chest.ThirdHint );
					}
					else
					{
						AddHtmlLocalized( 165, 157, 200, 40, 1018313, false, false ); // Used in unknown slot:
						AddCylinder( 350, 160, chest.FirstHint );

						if ( lockpicking >= 70.0 )
							AddCylinder( 350, 172, chest.SecondHint );
					}
				}

				PuzzleChestSolution lastGuess = chest.GetLastGuess( from );
				if ( lastGuess != null )
				{
					AddHtmlLocalized( 127, 249, 170, 20, 1018311, false, false ); // Thy previous guess:

					AddBackground( 290, 247, 115, 25, 0x13EC );

					AddCylinder( 281, 254, lastGuess.First );
					AddCylinder( 303, 254, lastGuess.Second );
					AddCylinder( 325, 254, lastGuess.Third );
					AddCylinder( 347, 254, lastGuess.Fourth );
					AddCylinder( 369, 254, lastGuess.Fifth );
				}

				AddPedestal( 140, 270, solution.First, 0, check == 0 );
				AddPedestal( 195, 270, solution.Second, 1, check == 1 );
				AddPedestal( 250, 270, solution.Third, 2, check == 2 );
				AddPedestal( 305, 270, solution.Fourth, 3, check == 3 );
				AddPedestal( 360, 270, solution.Fifth, 4, check == 4 );

				AddButton( 258, 370, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
			}
コード例 #3
0
ファイル: PuzzleChest.cs プロジェクト: phpjunkie420/ServUO
            public PuzzleGump(Mobile from, PuzzleChest chest, PuzzleChestSolution solution, int check)
                : base(50, 50)
            {
                m_From     = from;
                m_Chest    = chest;
                m_Solution = solution;

                Dragable = false;

                AddBackground(25, 0, 500, 410, 0x53);

                AddImage(62, 20, 0x67);

                AddHtmlLocalized(80, 36, 110, 70, 1018309, true, false); // A Puzzle Lock

                /* Correctly choose the sequence of cylinders needed to open the latch.  Each cylinder
                 * may potentially be used more than once.  Beware!  A false attempt could be deadly!
                 */
                AddHtmlLocalized(214, 26, 270, 90, 1018310, true, true);

                AddLeftCylinderButton(62, 130, PuzzleChestCylinder.LightBlue, 10);
                AddLeftCylinderButton(62, 180, PuzzleChestCylinder.Blue, 11);
                AddLeftCylinderButton(62, 230, PuzzleChestCylinder.Green, 12);
                AddLeftCylinderButton(62, 280, PuzzleChestCylinder.Orange, 13);

                AddRightCylinderButton(451, 130, PuzzleChestCylinder.Purple, 14);
                AddRightCylinderButton(451, 180, PuzzleChestCylinder.Red, 15);
                AddRightCylinderButton(451, 230, PuzzleChestCylinder.DarkBlue, 16);
                AddRightCylinderButton(451, 280, PuzzleChestCylinder.Yellow, 17);

                double lockpicking = from.Skills.Lockpicking.Base;

                if (lockpicking >= 60.0)
                {
                    AddHtmlLocalized(160, 125, 230, 24, 1018308, false, false); // Lockpicking hint:

                    AddBackground(159, 150, 230, 95, 0x13EC);

                    if (lockpicking >= 80.0)
                    {
                        AddHtmlLocalized(165, 157, 200, 40, 1018312, false, false); // In the first slot:
                        AddCylinder(350, 165, chest.Solution.First);

                        AddHtmlLocalized(165, 197, 200, 40, 1018313, false, false); // Used in unknown slot:
                        AddCylinder(350, 200, chest.FirstHint);

                        if (lockpicking >= 90.0)
                        {
                            AddCylinder(350, 212, chest.SecondHint);
                        }

                        if (lockpicking >= 100.0)
                        {
                            AddCylinder(350, 224, chest.ThirdHint);
                        }
                    }
                    else
                    {
                        AddHtmlLocalized(165, 157, 200, 40, 1018313, false, false); // Used in unknown slot:
                        AddCylinder(350, 160, chest.FirstHint);

                        if (lockpicking >= 70.0)
                        {
                            AddCylinder(350, 172, chest.SecondHint);
                        }
                    }
                }

                PuzzleChestSolution lastGuess = chest.GetLastGuess(from);

                if (lastGuess != null)
                {
                    AddHtmlLocalized(127, 249, 170, 20, 1018311, false, false); // Thy previous guess:

                    AddBackground(290, 247, 115, 25, 0x13EC);

                    AddCylinder(281, 254, lastGuess.First);
                    AddCylinder(303, 254, lastGuess.Second);
                    AddCylinder(325, 254, lastGuess.Third);
                    AddCylinder(347, 254, lastGuess.Fourth);
                    AddCylinder(369, 254, lastGuess.Fifth);
                }

                AddPedestal(140, 270, solution.First, 0, check == 0);
                AddPedestal(195, 270, solution.Second, 1, check == 1);
                AddPedestal(250, 270, solution.Third, 2, check == 2);
                AddPedestal(305, 270, solution.Fourth, 3, check == 3);
                AddPedestal(360, 270, solution.Fifth, 4, check == 4);

                AddButton(258, 370, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
            }
コード例 #4
0
        public TreasureChestLevel4() : base(0xE41)
        {
            this.SetChestAppearance();
            Movable      = false;
            LiftOverride = true;

            TrapType  = TrapType.ExplosionTrap;
            TrapPower = m_Level * Utility.Random(10, 25);
            Locked    = true;

            RequiredSkill = 92;
            Breakable     = false;
            LockLevel     = this.RequiredSkill - Utility.Random(1, 10);
            //MaxLockLevel = this.RequiredSkill;
            MaxLockLevel = 100;

            // According to OSI, loot in level 4 chest is:
            //  Gold 500 - 900
            //  Reagents
            //  Scrolls
            //  Blank scrolls
            //  Potions
            //  Gems
            //  Magic Wand
            //  Magic weapon
            //  Magic armour
            //  Magic clothing (not implemented)
            //  Magic jewelry (not implemented)
            //  Crystal ball (not implemented)

            // Gold
            DropItem(new Gold(Utility.Random(200, 400)));

            // Reagents
            for (int i = Utility.Random(1, m_Level); i > 1; i--)
            {
                Item ReagentLoot = Loot.RandomReagent();
                ReagentLoot.Amount = 12;
                DropItem(ReagentLoot);
            }

            // Scrolls
            for (int i = Utility.Random(1, m_Level); i > 1; i--)
            {
                Item ScrollLoot = Loot.RandomScroll(0, 47, SpellbookType.Regular);
                ScrollLoot.Amount = Utility.Random(1, 3);;
                DropItem(ScrollLoot);
            }

            // Drop blank scrolls
            DropItem(new BlankScroll(Utility.Random(1, m_Level)));

            // Potions
            for (int i = Utility.Random(1, m_Level); i > 1; i--)
            {
                Item PotionLoot = Loot.RandomPotion();
                DropItem(PotionLoot);
            }

            // Gems
            for (int i = Utility.Random(1, m_Level); i > 1; i--)
            {
                Item GemLoot = Loot.RandomGem();
                GemLoot.Amount = Utility.Random(1, 4);;
                DropItem(GemLoot);
            }


            // Equipment
            for (int i = Utility.Random(1, m_Level); i > 1; i--)
            {
                Item item = Loot.RandomArmorOrShieldOrWeapon();

                if (item is BaseWeapon)
                {
                    BaseWeapon weapon      = (BaseWeapon)item;
                    int        damageLevel = PseudoSeerStone.GetDamageLevel(m_Level);
                    if (PseudoSeerStone.HighestDamageLevelSpawn < damageLevel)
                    {
                        if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls)
                        {
                            DropItem(PuzzleChest.CreateRandomSkillScroll());
                        }
                        int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn);
                        if (platAmount > 0)
                        {
                            DropItem(new Platinum(platAmount));
                        }
                        damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                    }
                    weapon.DamageLevel     = (WeaponDamageLevel)damageLevel;
                    weapon.DurabilityLevel = (WeaponDurabilityLevel)PseudoSeerStone.GetDurabilityLevel(m_Level);
                    weapon.AccuracyLevel   = (WeaponAccuracyLevel)PseudoSeerStone.GetAccuracyLevel(m_Level);
                    weapon.Quality         = WeaponQuality.Regular;
                }
                else if (item is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)item;
                    armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(m_Level);
                    armor.Durability      = (ArmorDurabilityLevel)Utility.Random(m_Level);
                    armor.Quality         = ArmorQuality.Regular;
                }

                DropItem(item);
            }

            // Clothing
            for (int i = Utility.Random(1, 2); i > 1; i--)
            {
                DropItem(Loot.RandomClothing());
            }

            // Jewelry
            for (int i = Utility.Random(1, 2); i > 1; i--)
            {
                DropItem(Loot.RandomJewelry());
            }

            // Crystal ball (not implemented)
        }
コード例 #5
0
        public static void Fill(LockableContainer cont, int level, Expansion e)
        {
            cont.Movable = false;
            cont.Locked  = true;
            int numberItems;

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

                cont.DropItem(new Gold(Utility.RandomMinMax(25, 50))); // reduced from 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 = 95;
                    break;

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

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

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

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

                if (e >= Expansion.SE)
                {
                    switch (level)
                    {
                    case 1:
                        numberItems = 2;
                        break;

                    case 2:
                        numberItems = 4;
                        break;

                    case 3:
                        numberItems = 7;
                        break;

                    case 4:
                        numberItems = 10;
                        break;

                    case 5:
                        numberItems = 20;
                        break;

                    case 6:
                        numberItems = 30;
                        break;

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

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

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

                        int damageLevel = PseudoSeerStone.GetDamageLevel(level);

                        if (PseudoSeerStone.HighestDamageLevelSpawn < damageLevel)
                        {
                            if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls)
                            {
                                cont.DropItem(PuzzleChest.CreateRandomSkillScroll());
                            }

                            int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel *
                                             (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn);

                            if (platAmount > 0)
                            {
                                cont.DropItem(new Platinum(platAmount));
                            }

                            damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                        }

                        weapon.DamageLevel     = (WeaponDamageLevel)damageLevel;
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)PseudoSeerStone.GetDurabilityLevel(level);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)PseudoSeerStone.GetAccuracyLevel(level);

                        if (0.02 * level >= Utility.RandomDouble())
                        {
                            weapon.Slayer = (SlayerName)Utility.Random(28);
                        }

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

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

                        cont.DropItem(item);
                    }
                    else if (item is BaseHat || item is BaseJewel)
                    {
                        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(e);
                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 && cont.EraAOS)
            {
                cont.DropItem((Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]));
            }
        }
コード例 #6
0
ファイル: PuzzleChest.cs プロジェクト: zerodowned/UO-Forever
        protected void GenerateT()
        {
            if (0.001 >= Utility.RandomDouble())
            {
                PowerScroll ps = CreateRandomPowerScroll();
                DropItem(ps);
            }
            if (0.1 >= Utility.RandomDouble())
            {
                Item skillscroll = CreateRandomSkillScroll();
                DropItem(skillscroll);
            }

            DropItem(new Gold(2000, 4000));

            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 < 5; i++)
            {
                Item item;
                item = Loot.RandomArmorOrShieldOrWeapon();
                int level = 5;
                if (item is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)item;

                    int damageLevel = PseudoSeerStone.GetDamageLevel(level);
                    if (PseudoSeerStone.HighestDamageLevelSpawn < damageLevel)
                    {
                        if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls)
                        {
                            DropItem(PuzzleChest.CreateRandomSkillScroll());
                        }
                        int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn);
                        if (platAmount > 0)
                        {
                            DropItem(new Platinum(platAmount));
                        }
                        damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn;
                    }
                    weapon.DamageLevel     = (WeaponDamageLevel)damageLevel;
                    weapon.DurabilityLevel = (WeaponDurabilityLevel)PseudoSeerStone.GetDurabilityLevel(level);
                    weapon.AccuracyLevel   = (WeaponAccuracyLevel)PseudoSeerStone.GetAccuracyLevel(level);
                    if (0.02 * level >= Utility.RandomDouble())
                    {
                        weapon.Slayer = (SlayerName)Utility.Random(28);
                    }
                    DropItem(item);
                }
                else if (item is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)item;

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

                    DropItem(item);
                }
            }
        }