Пример #1
0
        private static Item GetRandomSpecial(int level, Map map)
        {
            Item special;

            switch (Utility.Random(8))
            {
            default:
            case 0: special = new CreepingVine(); break;

            case 1: special = new MessageInABottle(); break;

            case 2: special = new ScrollOfAlacrity(PowerScroll.Skills[Utility.Random(PowerScroll.Skills.Count)]); break;

            case 3: special = new Skeletonkey(); break;

            case 4: special = new TastyTreat(5); break;

            case 5: special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), map); break;

            case 6: special = GetRandomRecipe(); break;

            case 7: special = ScrollOfTranscendence.CreateRandom(1, 5); break;
            }

            return(special);
        }
Пример #2
0
        public override void OnComponentUsed(AddonComponent component, Mobile from)
        {
            BaseHouse house = BaseHouse.FindHouseAt(from);

            if (house != null && (house.IsOwner(from) || (house.LockDowns.ContainsKey(this) && house.LockDowns[this] == from)))
            {
                if (ResourceCount > 0)
                {
                    ResourceCount--;
                    Item item = ScrollOfTranscendence.CreateRandom(1, 1);

                    from.AddToBackpack(item);
                    from.SendLocalizedMessage(1154177); // Scrolls of Transcendence have been placed in your backpack.
                }
            }
            else
            {
                from.SendLocalizedMessage(502092); // You must be in your house to do this.
            }
        }
Пример #3
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
        }