Exemplo n.º 1
0
		public static void Fill( LockableContainer cont, int level )
		{
			cont.Movable = false;
			cont.TrapEnabled = false;
			cont.Locked = false;

			int bandies = CoreAI.SpiritDepotBandies;
			int ghpots = CoreAI.SpiritDepotGHPots;
			int regs = CoreAI.SpiritDepotReagents;
			int trpots = CoreAI.SpiritDepotTRPots;

			Item item = null;

			// add a couple lesser explosion potions
			//	these are for batteling hiders in the cave and not for damage
			for( int ix=0; ix < 2; ix++ )
			{
				item = new LesserExplosionPotion();
				cont.DropItem(item);
			}

			// add bandages
			item = new Bandage(bandies);
			cont.DropItem(item);

			// add greater heal potions
			for( int ix=0; ix < ghpots; ix++ )
			{
				item = new GreaterHealPotion();
				cont.DropItem(item);
			}

			// add total refresh potions
			for( int ix=0; ix < trpots; ix++ )
			{
				item = new TotalRefreshPotion();
				cont.DropItem(item);
			}
			// drop reagents
			cont.DropItem( new BagOfReagents( regs ) );

			// drop res scroll
			cont.DropItem( new ResurrectionScroll() ); 

			return;
		}
        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
            }
            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;

                if (Utility.RandomBool())
                {
                    cont.DropItem(new Gold(Utility.RandomMinMax(level * 10, (level * 10) + 10)));

                    int gems = level * 2;

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

                    for (int i = 0; i < numberItems; ++i)
                    {
                        cont.DropItem(Loot.RandomArmorOrShieldOrWeaponOrJewelry());
                    }

                    int reagents = 6;

                    for (int i = 0; i < reagents; i++)
                    {
                        Item item = Loot.RandomPossibleReagent();
                        item.Amount = Utility.RandomMinMax(level + 1, (level + 1) * 3);
                        cont.DropItem(item);
                    }
                }
            }
        }
Exemplo n.º 3
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)]));
            }
        }
Exemplo n.º 4
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)));
            }
            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));
                }

                numberItems = level * 6;

                for (int i = 0; i < numberItems; ++i)
                {
                    LootPack.OldSuperBossMagicItems.Generate(null, cont, true, 100);
                }
            }

            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)]));
            }
        }
Exemplo n.º 5
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
        }
Exemplo n.º 6
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 * 2; ++i )
					cont.DropItem( Loot.RandomScroll( 0, 63, SpellbookType.Regular ) );

				if ( Core.SE)
				{
					switch ( level )
					{
						case 1: numberItems = 5; break;
						case 2: numberItems = 10; break;
						case 3: numberItems = 15; break;
						case 4: numberItems = 38; break;
						case 5: numberItems = 50; break;
						case 6: numberItems = 60; break;
						default: numberItems = 0; break;
					};
				}
				else
					numberItems = level * 6;
				
				for ( int i = 0; i < numberItems; ++i )
				{
					Item item;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

						cont.DropItem( item );
					}
				}
			}

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

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

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

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

			if ( level == 6 && Core.AOS )
				cont.DropItem( (Item)Activator.CreateInstance( m_Artifacts[Utility.Random(m_Artifacts.Length)] ) );
		}
        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(200, 300)));

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

                case 2: cont.RequiredSkill = 50; break;

                case 3: cont.RequiredSkill = 75; break;

                case 4: cont.RequiredSkill = 90; break;

                case 5: cont.RequiredSkill = 98; break;

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

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

                var gold = new Gold(level * 500);
                if (level == 6)
                {
                    gold.Amount = 5000;
                }

                cont.DropItem(gold);

                int reagents = level == 0 ? 4 : 8;

                //TEST: FIX

                /*
                 * for (int i = 0; i < reagents; i++)
                 * {
                 *  Item item = Loot.RandomPossibleReagent();
                 *  item.Amount = RegsPerLevel[level];
                 *  cont.DropItem(item);
                 * }
                 *
                 * for (int i = 0; i < level * 3; ++i)
                 *  cont.DropItem(Loot.RandomScroll(0, Math.Min(47, (level + 1) * 8 - 1), SpellbookType.Regular));
                 * */

                int minimumMod = 1;
                int maximumMod = MaxModPerLevel[level];

                //Luthius Expansion
                double craftingComponentLoops = 4;
                double prestigeScrollLoops    = 3;
                double spellHueDeedLoops      = 1;

                double craftingComponentChance = .02;
                double prestigeScrollChance    = .1;
                double spellHueDeedChance      = .005;

                switch (level)
                {
                case 1:
                    craftingComponentChance = .10;
                    prestigeScrollChance    = .1;
                    spellHueDeedChance      = .005;
                    break;

                case 2:
                    craftingComponentChance = .15;
                    prestigeScrollChance    = .2;
                    spellHueDeedChance      = .01;
                    break;

                case 3:
                    craftingComponentChance = .20;
                    prestigeScrollChance    = .3;
                    spellHueDeedChance      = .015;
                    break;

                case 4:
                    craftingComponentChance = .25;
                    prestigeScrollChance    = .4;
                    spellHueDeedChance      = .02;
                    break;

                case 5:
                    craftingComponentChance = .30;
                    prestigeScrollChance    = .5;
                    spellHueDeedChance      = .025;
                    break;

                case 6:
                    craftingComponentChance = .40;
                    prestigeScrollChance    = .6;
                    spellHueDeedChance      = .03;
                    break;
                }

                for (int a = 0; a < craftingComponentLoops; a++)
                {
                    if (Utility.RandomDouble() <= craftingComponentChance)
                    {
                        cont.DropItem(CraftingComponent.GetRandomCraftingComponent(1));
                    }
                }

                for (int a = 0; a < spellHueDeedLoops; a++)
                {
                    if (Utility.RandomDouble() <= spellHueDeedChance)
                    {
                        cont.DropItem(new SpellHueDeed());
                    }
                }

                for (int i = 0; i < ItemsPerLevel[level]; ++i)
                {
                    if (Utility.RandomDouble() < 0.30)
                    {
                        //TEST: FIX

                        /*
                         * BaseWeapon weapon = Loot.RandomWeapon();
                         * weapon.DamageLevel = (WeaponDamageLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                         * weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                         * weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                         *
                         * cont.DropItem(weapon);
                         * */
                    }

                    else
                    {
                        //TEST: FIX

                        /*
                         * BaseArmor armor = Loot.RandomArmorOrShield();
                         * armor.ProtectionLevel = (ArmorProtectionLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                         * armor.DurabilityLevel = (ArmorDurabilityLevel)Utility.RandomMinMax(minimumMod, maximumMod);
                         *
                         * cont.DropItem(armor);
                         * */
                    }
                }
            }

            //TEST: FIX

            /*
             * for (int i = 0; i < level; i++)
             * {
             *  Item item = Loot.RandomGem();
             *  item.Amount = GemsPerLevel[level];
             *  cont.DropItem(item);
             * }
             * */

            // rares
            if (level == 6 && Utility.Random(50) == 0)
            {
                cont.DropItem(new SpecialHairDye());
            }

            switch (level)
            {
            case 6:
                if (Utility.RandomDouble() < 0.09)
                {
                    cont.DropItem(new SkillMasteryScroll());
                }
                break;

            case 5:
                break;

            case 4:
                if (Utility.RandomDouble() < 0.03)
                {
                    cont.DropItem(new BossCloth());
                }
                break;

            default:
                if (Utility.RandomDouble() < RareChancePerLevel[level])
                {
                    int index = Utility.Random(LootPack.RareCraftingIngredients.Length);
                    var rare  = LootPack.RareCraftingIngredients[index].Construct();
                    cont.DropItem(rare);
                }
                break;
            }

            int chance = 610 - (100 * level);

            if (Utility.Random(chance) == 0)
            {
                cont.DropItem(new RareCloth());
            }
        }
Exemplo n.º 8
0
		public static void Fill( LockableContainer cont, int level, bool IsThemed, ChestThemeType type )
		{
			cont.Movable = false;

			// the speial Overland Treasure Hunter NPC 'unlocks' the chest for you!
			if (TreasureTheme.IsOverlandTheme(type) == false)
			{
                cont.TrapType = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
				cont.TrapPower = level * 25;
				cont.Locked = 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;
			}

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

			// add theme loot
			AddThemeLoot(cont, level, type);

			// now for the gold
		    cont.DropItem( new Gold( level * 1000 ) );

			//if not a undead or pirate chest add scrolls
			if(type !=ChestThemeType.Pirate || type != ChestThemeType.Undead)
			{
				// adam: Changed to drop scrolls appropriatre for the level.
				for ( int i = 0; i < level * 5; ++i )
				{
					int minCircle = level;
					int maxCircle = (level + 3);
					PackScroll( cont, minCircle, maxCircle );
				}

			}

			// magic armor and weapons
			int count = MagicArmsThrottle(level);		// calc amount of magic armor and weapons to drop
			if (IsThemed == true) count /= 2;			// adam: Less loot if a themed chest because they get other goodies.
			for ( int i = 0; i < count; ++i )
			{
				Item item;
				item = Loot.RandomArmorOrShieldOrWeapon();
				item = Loot.ImbueWeaponOrArmor (item, level, 0.05, false);

				// erl: SDrop chance
				// ..
				if( Server.Engines.SDrop.SDropTest( item, CoreAI.EScrollChance ) )
				{
					// Drop a scroll instead
					EnchantedScroll escroll = Loot.GenEScroll((object) item);

					// Delete the original item
					item.Delete();

					// Re-reference item to escroll and continue
					item = (Item) escroll;
				}
				// ..

				cont.DropItem( item );
			}

			PackRegs(cont, level * 20);
			PackGems(cont, level * 10);
		}
Exemplo n.º 9
0
		private static void AddThemeLoot (LockableContainer cont, int level, ChestThemeType type)
		{
			MonsterStatuette mx = null;

			//switch to add in theme treasures
			switch ( type )
			{
				case ChestThemeType.Solen:
				{

					//drop are special weapon
					QuarterStaff special = new QuarterStaff();
					special.Name = "Chitanous Staff";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					//go into dropping normal loot

					int onlyonedrop = Utility.RandomMinMax(0,1);

					if(onlyonedrop ==0 )cont.DropItem(new Seed(PlantType.Hedge,0,false)); //new solen seed
					if(onlyonedrop ==1 )cont.DropItem(new WaterBucket() ); //new waterbucket

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[0]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[1]);
						mx.LootType = LootType.Regular;		// not blessed
						cont.DropItem( mx );			// drop it baby!
					}
					break;
				}

				case ChestThemeType.Brigand:
				{
					//drop are special weapon
					Katana special = new Katana();
					special.Name = "Bandit's Blade";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);

					if(onlyonedrop ==0 )cont.DropItem(new Brazier(true)); //new movable brazier
					if(onlyonedrop ==1 )cont.DropItem(new DecorativeBow(Utility.RandomMinMax(0,3))); //random decorative bow type

					for ( int i = 0; i < level * 5; ++i )
					{
						cont.DropItem (new PowderOfTranslocation() );  //drop powder of translocation
					}

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[2]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[3]);
						mx.LootType = LootType.Regular;		// not blessed
						cont.DropItem( mx );			// drop it baby!
					}
					break;
				}

				case ChestThemeType.Savage:
				{
					//drop are special weapon
					ShortSpear special = new ShortSpear();
					special.Name = "Ornate Ritual Spear";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int rug = Utility.RandomMinMax(0,1);
					int onlyonedrop = Utility.RandomMinMax(0,1);

					if(onlyonedrop ==0 )cont.DropItem(new SkullPole() ); //new skull pole

					if(onlyonedrop ==1 )
					{
						if(rug == 0) cont.DropItem(new BrownBearRugEastDeed() ); //new rug east
						if(rug == 1) cont.DropItem(new BrownBearRugSouthDeed() ); //new rug south
					}

					if (Utility.RandomDouble() <= .30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[4]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[5]);
						mx.LootType = LootType.Regular;			// not blessed
						cont.DropItem( mx );				// drop it baby!
					}
					break;
				}

				case ChestThemeType.Undead:
				{
					Halberd special = new Halberd();
					special.Name = "Soul Reaver";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);
					if(onlyonedrop ==0 )cont.DropItem(new BoneContainer(Utility.RandomMinMax(0,2))); //new bone container 3 differnt types 0-2
					int stone = Utility.RandomMinMax(0,3); // get random gravestone type to drop

					if(onlyonedrop ==1 )
					{
						if(stone == 0) cont.DropItem(new GraveStone1());
						if(stone == 1) cont.DropItem(new GraveStone2());
						if(stone == 2) cont.DropItem(new GraveStone3());
						if(stone == 3) cont.DropItem(new GraveStone4());
					}

					for ( int i = 0; i < level * 5; ++i )
					{
						cont.DropItem(new Moonstone()); //drop moonstones
					}

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[6]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[7]);
						mx.LootType = LootType.Regular;			// not blessed
						cont.DropItem( mx );				// drop it baby!
					}
					break;
				}

				case ChestThemeType.Pirate:
				{

					Bow special = new Bow();
					special.Name = "Bow of the Buccaneer";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);
					PirateHat hat = new PirateHat();
					hat.Hue = 0x1;
					int oars = Utility.RandomMinMax(0,1); //2 oar types

					if(onlyonedrop ==0 )
					{
						if(oars == 0) cont.DropItem(new Oars1());
						if(oars == 1) cont.DropItem(new Oars2());
					}

					if(onlyonedrop == 1 )cont.DropItem(new GenieBottle(false) ); //lamp currently disabled genie not done
					if (Utility.RandomDouble() <= 0.50 )cont.DropItem(hat); // 50% chance at black piratehat

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[8]);
						if(whichone == 1) mx = new MonsterStatuette (m_Monster[9]);
						mx.LootType = LootType.Regular;					// not blessed
						cont.DropItem( mx );						// drop it baby!
					}
					break;
				}

				case ChestThemeType.Dragon:
				{
					WarFork special = new WarFork();
					special.Name = "Claw of the Dragon";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);
					//new dragonhead trophydeed type
					if(onlyonedrop ==0 ) cont.DropItem(new TrophyDeed(8757, 8756, "a dragon head trophy", "a dragon head trophy", 10 ));
					int armor = Utility.RandomMinMax(0,2); // drop 1 piece of dragonarmor

					if(onlyonedrop == 1 )
					{
						if(armor == 0) cont.DropItem(new HangingDragonChest());
						if(armor == 1) cont.DropItem(new HangingDragonLegs());
						if(armor == 2) cont.DropItem(new HangingDragonArms());
					}

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[10]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[11]);
						mx.LootType = LootType.Regular;			// not blessed
						cont.DropItem( mx );				// drop it baby!
					}
					break;
				}

				case ChestThemeType.Lizardmen: 
				{
					if (Utility.RandomBool())
						cont.DropItem( new LizardmansStaff() ); 
					else
						cont.DropItem( new LizardmansMace() ); 
				}
					break;
				
				case ChestThemeType.Ettin:
				{
					cont.DropItem( new EttinHammer() ); 
				}
					break;
				
				case ChestThemeType.Ogre: 
				{
					cont.DropItem( new OgresClub() ); 
				}
					break;

				case ChestThemeType.Ophidian:
				{
					cont.DropItem( new OphidianBardiche() ); 
				}
					break;
				
				case ChestThemeType.Skeleton:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new SkeletonScimitar() ); break;
						case 1: cont.DropItem( new SkeletonAxe() ); break;
						case 2: cont.DropItem( new BoneMageStaff() ); break;
					}
				}
					break;

				case ChestThemeType.Ratmen:
				{
					if (Utility.RandomBool())
						cont.DropItem( new RatmanSword() ); 
					else
						cont.DropItem( new RatmanAxe() ); 
				}
					break;

				case ChestThemeType.Orc:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new OrcClub() ); break;
						case 1: cont.DropItem( new OrcMageStaff() ); break;
						case 2: cont.DropItem( new OrcLordBattleaxe() ); break;
					}
				}
					break;

				case ChestThemeType.Terathan:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new TerathanStaff() ); break;
						case 1: cont.DropItem( new TerathanSpear() ); break;
						case 2: cont.DropItem( new TerathanMace() ); break;
					}
				}
					break;

				case ChestThemeType.FrostTroll:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new FrostTrollClub() ); break;
						case 1: cont.DropItem( new TrollAxe() ); break;
						case 2: cont.DropItem( new TrollMaul() ); break;
					}
				}
					break;

			}//end switch

		}
Exemplo n.º 10
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked = true;

            cont.TrapType = TrapType.ExplosionTrap;
            cont.TrapPower = level * 25;

            switch ( level )
            {
                case 0: cont.RequiredSkill = 1; break;
                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;
            }

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

            double maskChance = 0.1 * level;

            if ( Utility.RandomDouble() < maskChance )
            {
                Item mask = null;
                switch ( Utility.Random( 4 ) )
                {
                    case 0: mask = new OrcishKinMask(); break;
                    case 1: mask = new TribalMask(); break;
                    case 2: mask = new DeerMask(); break;
                    case 3:
                    default:mask = new BearMask(); break;
                }

                cont.DropItem( mask );
            }

            //int gold = 1000 * level;
            //cont.DropItem( new Gold( gold ) );

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

            /*for (int i = 0; i < level * 2; i++)
            {
                cont.DropItem(new Gold(Utility.RandomMinMax(100, 600)));

                // this give magic weapons over 25% of the time with a 15% chance for a vanq even at level 1. That is insane.
                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);
                }
            }*/

            for ( int i = 0; i < level; ++i )
            {
                // This is much more sane.
                LootPack.OldSuperBoss.Generate( cont );
            }

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

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

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

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

                cont.RequiredSkill = level switch
                {
                    1 => 36,
                    2 => 76,
                    3 => 84,
                    4 => 92,
                    5 => 100,
                    6 => 100,
                    _ => cont.RequiredSkill
                };

                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 (var i = 0; i < level * 5; ++i)
                {
                    cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                }

                if (Core.SE)
                {
                    numberItems = level switch
                    {
                        1 => 5,
                        2 => 10,
                        3 => 15,
                        4 => 38,
                        5 => 50,
                        6 => 60,
                        _ => 0
                    }
                }
                ;
Exemplo n.º 12
0
        private static void AddThemeLoot(LockableContainer cont, int level, ChestThemeType type)
        {
            MonsterStatuette mx = null;

            //switch to add in theme treasures
            switch (type)
            {
            case ChestThemeType.Solen:
            {
                //drop are special weapon
                QuarterStaff special = new QuarterStaff();
                special.Name = "Chitanous Staff";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                //go into dropping normal loot

                int onlyonedrop = Utility.RandomMinMax(0, 1);

                if (onlyonedrop == 0)
                {
                    cont.DropItem(new Seed(PlantType.Hedge, 0, false));                                       //new solen seed
                }
                if (onlyonedrop == 1)
                {
                    cont.DropItem(new WaterBucket());                        //new waterbucket
                }
                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[0]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[1]);
                    }
                    mx.LootType = LootType.Regular;                                     // not blessed
                    cont.DropItem(mx);                                                  // drop it baby!
                }
                break;
            }

            case ChestThemeType.Brigand:
            {
                //drop are special weapon
                Katana special = new Katana();
                special.Name = "Bandit's Blade";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int onlyonedrop = Utility.RandomMinMax(0, 1);

                if (onlyonedrop == 0)
                {
                    cont.DropItem(new Brazier(true));                                         //new movable brazier
                }
                if (onlyonedrop == 1)
                {
                    cont.DropItem(new DecorativeBow(Utility.RandomMinMax(0, 3)));                                        //random decorative bow type
                }
                for (int i = 0; i < level * 5; ++i)
                {
                    cont.DropItem(new PowderOfTranslocation());                                //drop powder of translocation
                }

                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[2]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[3]);
                    }
                    mx.LootType = LootType.Regular;                                     // not blessed
                    cont.DropItem(mx);                                                  // drop it baby!
                }
                break;
            }

            case ChestThemeType.Savage:
            {
                //drop are special weapon
                ShortSpear special = new ShortSpear();
                special.Name = "Ornate Ritual Spear";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int rug         = Utility.RandomMinMax(0, 1);
                int onlyonedrop = Utility.RandomMinMax(0, 1);

                if (onlyonedrop == 0)
                {
                    cont.DropItem(new SkullPole());                                          //new skull pole
                }
                if (onlyonedrop == 1)
                {
                    if (rug == 0)
                    {
                        cont.DropItem(new BrownBearRugEastDeed());                                       //new rug east
                    }
                    if (rug == 1)
                    {
                        cont.DropItem(new BrownBearRugSouthDeed());                                       //new rug south
                    }
                }

                if (Utility.RandomDouble() <= .30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[4]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[5]);
                    }
                    mx.LootType = LootType.Regular;                                             // not blessed
                    cont.DropItem(mx);                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Undead:
            {
                Halberd special = new Halberd();
                special.Name = "Soul Reaver";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int onlyonedrop = Utility.RandomMinMax(0, 1);
                if (onlyonedrop == 0)
                {
                    cont.DropItem(new BoneContainer(Utility.RandomMinMax(0, 2))); //new bone container 3 differnt types 0-2
                }
                int stone = Utility.RandomMinMax(0, 3);                           // get random gravestone type to drop

                if (onlyonedrop == 1)
                {
                    if (stone == 0)
                    {
                        cont.DropItem(new GraveStone1());
                    }
                    if (stone == 1)
                    {
                        cont.DropItem(new GraveStone2());
                    }
                    if (stone == 2)
                    {
                        cont.DropItem(new GraveStone3());
                    }
                    if (stone == 3)
                    {
                        cont.DropItem(new GraveStone4());
                    }
                }

                for (int i = 0; i < level * 5; ++i)
                {
                    cont.DropItem(new Moonstone());                             //drop moonstones
                }

                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[6]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[7]);
                    }
                    mx.LootType = LootType.Regular;                                             // not blessed
                    cont.DropItem(mx);                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Pirate:
            {
                Bow special = new Bow();
                special.Name = "Bow of the Buccaneer";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int       onlyonedrop = Utility.RandomMinMax(0, 1);
                PirateHat hat         = new PirateHat();
                hat.Hue = 0x1;
                int oars = Utility.RandomMinMax(0, 1);                        //2 oar types

                if (onlyonedrop == 0)
                {
                    if (oars == 0)
                    {
                        cont.DropItem(new Oars1());
                    }
                    if (oars == 1)
                    {
                        cont.DropItem(new Oars2());
                    }
                }

                if (onlyonedrop == 1)
                {
                    cont.DropItem(new GenieBottle(false));                                           //lamp currently disabled genie not done
                }
                if (Utility.RandomDouble() <= 0.50)
                {
                    cont.DropItem(hat);                                      // 50% chance at black piratehat
                }
                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[8]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[9]);
                    }
                    mx.LootType = LootType.Regular;                                                             // not blessed
                    cont.DropItem(mx);                                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Dragon:
            {
                WarFork special = new WarFork();
                special.Name = "Claw of the Dragon";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int onlyonedrop = Utility.RandomMinMax(0, 1);
                //new dragonhead trophydeed type
                if (onlyonedrop == 0)
                {
                    cont.DropItem(new TrophyDeed(8757, 8756, "a dragon head trophy", "a dragon head trophy", 10));
                }
                int armor = Utility.RandomMinMax(0, 2);                        // drop 1 piece of dragonarmor

                if (onlyonedrop == 1)
                {
                    if (armor == 0)
                    {
                        cont.DropItem(new HangingDragonChest());
                    }
                    if (armor == 1)
                    {
                        cont.DropItem(new HangingDragonLegs());
                    }
                    if (armor == 2)
                    {
                        cont.DropItem(new HangingDragonArms());
                    }
                }

                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[10]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[11]);
                    }
                    mx.LootType = LootType.Regular;                                             // not blessed
                    cont.DropItem(mx);                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Lizardmen:
            {
                if (Utility.RandomBool())
                {
                    cont.DropItem(new LizardmansStaff());
                }
                else
                {
                    cont.DropItem(new LizardmansMace());
                }
            }
            break;

            case ChestThemeType.Ettin:
            {
                cont.DropItem(new EttinHammer());
            }
            break;

            case ChestThemeType.Ogre:
            {
                cont.DropItem(new OgresClub());
            }
            break;

            case ChestThemeType.Ophidian:
            {
                cont.DropItem(new OphidianBardiche());
            }
            break;

            case ChestThemeType.Skeleton:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new SkeletonScimitar()); break;

                case 1: cont.DropItem(new SkeletonAxe()); break;

                case 2: cont.DropItem(new BoneMageStaff()); break;
                }
            }
            break;

            case ChestThemeType.Ratmen:
            {
                if (Utility.RandomBool())
                {
                    cont.DropItem(new RatmanSword());
                }
                else
                {
                    cont.DropItem(new RatmanAxe());
                }
            }
            break;

            case ChestThemeType.Orc:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new OrcClub()); break;

                case 1: cont.DropItem(new OrcMageStaff()); break;

                case 2: cont.DropItem(new OrcLordBattleaxe()); break;
                }
            }
            break;

            case ChestThemeType.Terathan:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new TerathanStaff()); break;

                case 1: cont.DropItem(new TerathanSpear()); break;

                case 2: cont.DropItem(new TerathanMace()); break;
                }
            }
            break;

            case ChestThemeType.FrostTroll:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new FrostTrollClub()); break;

                case 1: cont.DropItem(new TrollAxe()); break;

                case 2: cont.DropItem(new TrollMaul()); break;
                }
            }
            break;
            }            //end switch
        }
Exemplo n.º 13
0
        public static void Fill(LockableContainer cont, int level, bool IsThemed, ChestThemeType type)
        {
            cont.Movable = false;

            // the speial Overland Treasure Hunter NPC 'unlocks' the chest for you!
            if (TreasureTheme.IsOverlandTheme(type) == false)
            {
                cont.TrapType  = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
                cont.TrapPower = level * 25;
                cont.Locked    = 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;
            }

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

            // add theme loot
            AddThemeLoot(cont, level, type);

            // now for the gold
            cont.DropItem(new Gold(level * 1000));

            //if not a undead or pirate chest add scrolls
            if (type != ChestThemeType.Pirate || type != ChestThemeType.Undead)
            {
                // adam: Changed to drop scrolls appropriatre for the level.
                for (int i = 0; i < level * 5; ++i)
                {
                    int minCircle = level;
                    int maxCircle = (level + 3);
                    PackScroll(cont, minCircle, maxCircle);
                }
            }

            // magic armor and weapons
            int count = MagicArmsThrottle(level);                       // calc amount of magic armor and weapons to drop

            if (IsThemed == true)
            {
                count /= 2;                                                     // adam: Less loot if a themed chest because they get other goodies.
            }
            for (int i = 0; i < count; ++i)
            {
                Item item;
                item = Loot.RandomArmorOrShieldOrWeapon();
                item = Loot.ImbueWeaponOrArmor(item, level, 0.05, false);

                // erl: SDrop chance
                // ..
                if (Server.Engines.SDrop.SDropTest(item, CoreAI.EScrollChance))
                {
                    // Drop a scroll instead
                    EnchantedScroll escroll = Loot.GenEScroll((object)item);

                    // Delete the original item
                    item.Delete();

                    // Re-reference item to escroll and continue
                    item = (Item)escroll;
                }
                // ..

                cont.DropItem(item);
            }

            PackRegs(cont, level * 20);
            PackGems(cont, level * 10);
        }
Exemplo n.º 14
0
		public static void Fill( LockableContainer cont, int level )
		{
			cont.Movable = false;
			cont.Locked = true;

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

				if( Utility.RandomDouble() < 0.75 )
					cont.DropItem( new TreasureMap( 0, Map.Backtrol ) );
			}
			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;

				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.SE )
						{
							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.SE )
						{
							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.SE )
						{
							int attributeCount;
							int min, max;

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

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

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

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

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

						cont.DropItem( item );
					}
				}
			}

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

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

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

			for( int i = 0; i < gems; i++ )
			{
				Item item = Loot.RandomGem();
				cont.DropItem( item );
			}
		}
Exemplo n.º 15
0
        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);
        }
Exemplo n.º 16
0
		private static void PackScroll( LockableContainer cont, int circle )
		{
			int min = (circle - 1) * 8;

			cont.DropItem( Loot.RandomScroll( min, min + 7, SpellbookType.Regular ) );
		}
Exemplo n.º 17
0
		public static void Fill( LockableContainer cont )
		{
			// Gold, about 100K
			for (int ix=0; ix < 100; ix++)
				cont.DropItem( new Gold( Utility.RandomMinMax( 900, 1100 ) ) );
			
			// plus about 20 chances for magic jewelry and/or clothing
			for (int ix=0; ix < 20; ix++)
			{
				PackMagicItem( cont, 3, 3, 0.20 );
				PackMagicItem( cont, 3, 3, 0.10 );
				PackMagicItem( cont, 3, 3, 0.05 );
			}

			// drop some scrolls and weapons/armor
			for ( int ix = 0; ix < 25; ++ix )
			{
				int level = 5;
				Item item;
				item = Loot.RandomArmorOrShieldOrWeapon();
				item = Loot.ImbueWeaponOrArmor (item, level, 0.05, false);

				// erl: SDrop chance
				// ..
				if( Server.Engines.SDrop.SDropTest( item, CoreAI.EScrollChance ) )
				{
					// Drop a scroll instead
					EnchantedScroll escroll = Loot.GenEScroll((object) item);

					// Delete the original item
					item.Delete();

					// Re-reference item to escroll and continue
					item = (Item) escroll;
				}
				// ..

				cont.DropItem( item );
			}

			// drop a few nice maps
			for (int ix=0; ix < 5; ix++)
			{
				TreasureMap map = new TreasureMap (5, Map.Felucca);
				cont.DropItem( map );				
			}

			// drop a few single-color leather dye tubs with 100 charges
			for (int ix=0; ix < 25; ix++)
			{
				LeatherArmorDyeTub tub = new LeatherArmorDyeTub ();
				cont.DropItem( tub );				
			}
			
			// pack some other goodies
			TreasureMapChest.PackRegs(cont, 300);
			TreasureMapChest.PackGems(cont, 300);

		}
Exemplo n.º 18
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
        }
Exemplo n.º 19
0
		public static void Fill( LockableContainer cont, int level )
		{
			cont.Movable = false;
            cont.TrapType = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
			cont.TrapPower = level * 25;
			cont.Locked = true;

			switch ( level )
			{
					// Adam: add level 0 (trainer chests)
				case 0: cont.RequiredSkill = Utility.RandomMinMax (30, 37) ; break;
				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;
			}

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

			// adam: change treasure map chest loot MIN-MAX so as to decrease daily take home
			if (level != 0)
				cont.DropItem( 
					new Gold( Utility.RandomMinMax( 
						(int)(((double)((level * 1000) / 3)) * .75), // min is 75% of MAX
						(level * 1000) / 3 ) ) );

            // skin tone creme for level 4 & 5 chests
            if (Utility.RandomDouble() < 0.05 && level > 3)
            {
                cont.DropItem(new SkinHueCreme());
            }

			// adam: scrolls * 3 and not 5
			for ( int i = 0; i < level * 3; ++i )
			{
				int minCircle = level;
				int maxCircle = (level + 3);
				PackScroll( cont, minCircle, maxCircle );
			}

			// plus "level chances" for magic jewelry & clothing
			switch (level)
			{
				case 0:	// Adam: trainer chest
				case 1:	// none
					break;	
				case 2:
					PackMagicItem( cont, 1, 1, 0.05 );
					break;
				case 3:
					PackMagicItem( cont, 1, 2, 0.10 );
					PackMagicItem( cont, 1, 2, 0.05 );
					break;
				case 4:
					PackMagicItem( cont, 2, 3, 0.10 );
					PackMagicItem( cont, 2, 3, 0.05 );
					PackMagicItem( cont, 2, 3, 0.02 );
					break;
				case 5:
                    PackMagicItem(cont, 3, 3, 0.10);
                    PackMagicItem(cont, 3, 3, 0.05);
                    PackMagicItem(cont, 3, 3, 0.02);
					break;
			}

			// TreasureMap( int level, Map map
			//	5% chance to get a treasure map
			//  Changed chance for tmap to 1%
			if (level != 0)
				if (Utility.RandomDouble() < 0.01)
				{
					int mlevel = level;

					//	20% chance to get a treasure map one level better than the level of this chest
					if (Utility.RandomDouble() < 0.20)
						mlevel += (level < 5) ? 1 : 0;	// bump up the map level by one

					TreasureMap map = new TreasureMap (mlevel, Map.Felucca);
					cont.DropItem( map );				// drop it baby!
				}

			// if You're doing a level 3, 4, or 5 chest you have a 1.5%, 2%, or 2.5% chance to get a monster statue
			double chance = 0.00 + (((double)level) * 0.005);
			if ( (level > 3) && (Utility.RandomDouble() < chance) )
			{
				int ndx = level - 3;
				MonsterStatuette mx =
					new MonsterStatuette(m_monsters[ndx][Utility.Random(m_monsters[ndx].Length)]);
				mx.LootType = LootType.Regular;					// not blessed
				cont.DropItem( mx );							// drop it baby!
			}

			TreasureMapChest.PackRegs(cont, level * 10);
			TreasureMapChest.PackGems(cont, level * 5);

		}
Exemplo n.º 20
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 );
            }
        }
Exemplo n.º 21
0
        public static void Fill(LockableContainer cont, int luck, int level, bool isSos)
        {
            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));
                }

                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;

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

            int reagents;

            if (level == 0)
            {
                reagents = 12;
            }
            else
            {
                reagents = level + 1;
            }

            for (int i = 0; i < reagents; i++)
            {
                Item item = Loot.RandomReagent();
                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);
            }

            Item arty    = null;
            Item special = null;

            if (isSos)
            {
                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.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (level >= 6)
                {
                    if (0.10 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (level >= 5)
                {
                    if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (.10 > Utility.RandomDouble())
                {
                    special = GetRandomSpecial(level, cont.Map);
                }
            }

            if (special != null)
            {
                cont.DropItem(special);
            }
        }
Exemplo n.º 22
0
        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 ) ) );

            }
            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 * 3000 ) );

            //Adding in a 10% chance for the same level map as your doing to spawn in the chest

                if ( 0.1 >= Utility.RandomDouble() && level == 1 )
                {
                    cont.DropItem( new TreasureMap( 1, Map.Felucca ) );
                }
                else if ( 0.1 >= Utility.RandomDouble() && level == 2 )
                {
                    cont.DropItem( new TreasureMap( 2, Map.Felucca ) );
                }
                else if ( 0.1 >= Utility.RandomDouble() && level == 3 )
                {
                    cont.DropItem( new TreasureMap( 3, Map.Felucca ) );
                }
                else if ( 0.1 >= Utility.RandomDouble() && level == 4 )
                {
                    cont.DropItem( new TreasureMap( 4, Map.Felucca ) );
                }
                else if ( 0.1 >= Utility.RandomDouble() && level == 5 )
                {
                    cont.DropItem( new TreasureMap( 5, Map.Felucca ) );
                }
                else if ( 0.1 >= Utility.RandomDouble() && level == 6 )
                {
                    cont.DropItem( new TreasureMap( 6, Map.Felucca ) );
                }
                else
                {
                }
            //end of add
                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 BaseHat )
                    {
                        BaseHat hat = (BaseHat)item;

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

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

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

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

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

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

                        cont.DropItem( item );
                    }
                }
            }

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

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

            int gems;
            if ( level == 0 )
                gems = 2;
            else
                gems = level * 5;

            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)] ) );
        }
Exemplo n.º 23
0
        public static void Fill(LockableContainer cont, int luck, int level, bool isSos)
        {
            cont.Movable = false;
            cont.Locked  = true;
            int numberItems;

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

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

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

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

                case 2:
                    cont.RequiredSkill = 76;
                    break;

                case 3:
                    cont.RequiredSkill = 84;
                    break;

                case 4:
                    cont.RequiredSkill = 92;
                    break;

                case 5:
                    cont.RequiredSkill = 105;
                    break;

                case 6:
                case 7:
                    cont.RequiredSkill = 110;
                    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));
                }

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

                    case 2:
                        numberItems = 40;
                        break;

                    case 3:
                        numberItems = 48;
                        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);

                        RunicReforging.GenerateRandomItem(item, LootPack.GetLuckChance(luck), min, max);

                        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.002 * level > Utility.RandomDouble())
                {
                    arty = Loot.Construct(m_SOSArtifacts);
                }
            }
            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);
            }
        }
        public static void Fill(LockableContainer cont, int level)
        {
            bool isFelucca = (cont.Map == Map.Felucca);
            bool inTokuno  = (cont.Map == Map.Tokuno);
            bool SoS       = false;

            if (cont.IsShipwreckedItem == true)
            {
                SoS = true;
            }

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

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

                cont.DropItem(new Gold(Utility.RandomMinMax(500, 1000)));

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

                // = Chest Lock Levels (~40% to open at cont.RequiredSkill / 100% at cont.MaxLockLevel)
                switch (level)
                {
                case 1: cont.RequiredSkill = 5; cont.LockLevel = -25; cont.MaxLockLevel = 55; break;

                case 2: cont.RequiredSkill = 45; cont.LockLevel = 25; cont.MaxLockLevel = 75; break;

                case 3: cont.RequiredSkill = 65; cont.LockLevel = 45; cont.MaxLockLevel = 95; break;

                case 4: cont.RequiredSkill = 75; cont.LockLevel = 55; cont.MaxLockLevel = 105; break;

                case 5: cont.RequiredSkill = 75; cont.LockLevel = 55; cont.MaxLockLevel = 105; break;

                case 6: cont.RequiredSkill = 80; cont.LockLevel = 60; cont.MaxLockLevel = 110; break;

                case 7: cont.RequiredSkill = 80; cont.LockLevel = 60; cont.MaxLockLevel = 110; break;
                }

                // = GOLD PIECES
                cont.DropItem(new Gold(level * 5000));

                // = TREASURE MAP or MiB
                if (!SoS)
                {
                    if (Utility.RandomDouble() < 0.2)
                    {
                        cont.DropItem(new TreasureMap(level, MapItem.GetRandomFacet()));
                    }
                    else if ((level < 7) && (Utility.RandomDouble() < 0.025))
                    {
                        cont.DropItem(new TreasureMap(level + 1, MapItem.GetRandomFacet()));
                    }
                    else if (Utility.RandomDouble() > 0.8)
                    {
                        if (Utility.RandomDouble() > 0.5)
                        {
                            cont.DropItem(new MessageInABottle(Map.Felucca));
                        }
                        else
                        {
                            cont.DropItem(new MessageInABottle(Map.Trammel));
                        }
                    }
                }
                else if (!SoS)
                {
                    int soslvl = Utility.Random(level) + 1;

                    if (Utility.RandomDouble() < 0.2)
                    {
                        cont.DropItem(new TreasureMap(soslvl, MapItem.GetRandomFacet()));
                    }
                }

                // = LEVEL 8 ARCANE SCROLLS
                for (int i = 0; i < level; ++i)
                {
                    cont.DropItem(Loot.RandomScroll(57, 64, SpellbookType.Regular));
                }

                // = MAGIC ITEMS
                Item item;

                numberItems = 24 + (level * 8);
                for (int i = 0; i < numberItems; ++i)
                {
                    if (Core.AOS)
                    {
                        item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(inTokuno);
                    }
                    else
                    {
                        item = Loot.RandomArmorOrShieldOrWeapon(inTokuno);
                    }

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

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

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

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

                        cont.DropItem(item);
                    }
                }
            }

            // = REAGENTS
            int reagents;

            if (level == 0)
            {
                reagents = 10;
            }
            else
            {
                reagents = 3 + level;
            }

            for (int i = 0; i < reagents; i++)
            {
                Item itr = Loot.RandomPossibleReagent();
                itr.Amount = Utility.RandomMinMax(40, 60);
                cont.DropItem(itr);
            }
            // = STACK OF GEMS
            int gems;

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

            Item itg  = new Citrine();
            int  rndG = Utility.Random(9) + 1;

            if (rndG == 1)
            {
                itg = new Amber(gems);
            }
            if (rndG == 2)
            {
                itg = new Amethyst(gems);
            }
            if (rndG == 3)
            {
                itg = new Citrine(gems);
            }
            if (rndG == 4)
            {
                itg = new Diamond(gems);
            }
            if (rndG == 5)
            {
                itg = new Emerald(gems);
            }
            if (rndG == 6)
            {
                itg = new Ruby(gems);
            }
            if (rndG == 7)
            {
                itg = new Sapphire(gems);
            }
            if (rndG == 8)
            {
                itg = new StarSapphire(gems);
            }
            if (rndG == 9)
            {
                itg = new Tourmaline(gems);
            }
            cont.DropItem(itg);

            // = SCROLL OF ALACRITY or POWERSCROLL
            if (level > 1)
            {
                if (Utility.RandomDouble() < (0.02 + (level / 200)))
                {
                    SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length);
                    cont.DropItem(PowerScroll.CreateRandomNoCraft(5, 5));
                }
                else if (Utility.RandomDouble() < 0.075)
                {
                    SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length);
                    cont.DropItem(new ScrollofAlacrity(WhatS));
                }
            }

            // = SCROLL OF TRANCENDENCE
            if (level >= 4 && isFelucca && Utility.RandomDouble() > 0.9)
            {
                cont.DropItem(ScrollofTranscendence.CreateRandom(level, level * 5));
            }

            // = CREEPING VINES
            if (!SoS && Utility.RandomDouble() < 0.075)
            {
                cont.DropItem(new CreepingVines());
            }

            // = ILSHENAR LESSER ARTIFACT
            if (level >= 6 && Core.AOS)
            {
                cont.DropItem((Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]));
            }

            // = SKELETON KEY
            if (level < 7)
            {
                if (!SoS && Utility.RandomDouble() > (0.92 - (level / 100)))
                {
                    cont.DropItem(new SFSkeletonKey());
                }
            }
            // = [LVL 7] = MASTER SKELETON KEY
            if (level == 7)
            {
                if (Utility.RandomDouble() < 0.10)
                {
                    cont.DropItem(new SFMasterSkeletonKey());
                }
            }
        }
Exemplo n.º 25
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);
            }
        }
Exemplo n.º 26
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;

            cont.TrapType  = TrapType.ExplosionTrap;
            cont.TrapPower = level * 25;

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

            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;
            }

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

            double maskChance = 0.1 * level;

            if (Utility.RandomDouble() < maskChance)
            {
                Item mask = null;
                switch (Utility.Random(4))
                {
                case 0: mask = new OrcishKinMask(); break;

                case 1: mask = new TribalMask(); break;

                case 2: mask = new DeerMask(); break;

                case 3:
                default: mask = new BearMask(); break;
                }

                cont.DropItem(mask);
            }

            //int gold = 1000 * level;
            //cont.DropItem( new Gold( gold ) );

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

            /*for (int i = 0; i < level * 2; i++)
             * {
             *  cont.DropItem(new Gold(Utility.RandomMinMax(100, 600)));
             *
             *  // this give magic weapons over 25% of the time with a 15% chance for a vanq even at level 1. That is insane.
             *  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);
             *  }
             * }*/

            for (int i = 0; i < level; ++i)
            {
                // This is much more sane.
                LootPack.OldSuperBoss.Generate(cont);
            }

            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(20, 60);
                cont.DropItem(item);
            }

            int gems;

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

            for (int i = 0; i < gems; i++)
            {
                Item item = Loot.RandomGem();
                cont.DropItem(item);
            }
        }
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;

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

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

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

                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)
            {
                Item item = (Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]);
                if (cont is TreasureMapChest && (cont as TreasureMapChest).Owner.AccessLevel > AccessLevel.Player && Miscellanious.ValidateLabeling(item))
                {
                    item.Cheater_Name = String.Format("This item received by GM {0}", (cont as TreasureMapChest).Owner.Name);
                }
                cont.DropItem(item);
            }
        }
Exemplo n.º 28
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable   = false;
            cont.TrapType  = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
            cont.TrapPower = level * 25;
            cont.TrapLevel = level;
            cont.Locked    = true;

            switch (level)
            {
            // Adam: add level 0 (trainer chests)
            case 0: cont.RequiredSkill = Utility.RandomMinMax(30, 37); break;

            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;
            }

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

            // adam: change treasure map chest loot MIN-MAX so as to decrease daily take home
            if (level != 0)
            {
                int amount = Utility.RandomMinMax(
                    (int)(((double)((level * 1000) / 3)) * .75),                             // min is 75% of MAX
                    (level * 1000) / 3);

                //int piles = level * 2;	// cool way but the players whined
                int piles = 1;                                          // sissy way

                // make several piles
                for (int ix = 0; ix < piles; ix++)
                {
                    cont.DropItem(new Gold(Utility.RandomMinMax(amount / piles - 10, amount / piles + 10)));
                }
            }


            // skin tone creme for level 4 & 5 chests
            if (Utility.RandomDouble() < 0.05 && level > 3)
            {
                cont.DropItem(new SkinHueCreme());
            }

            // adam: scrolls * 3 and not 5
            for (int i = 0; i < level * 3; ++i)
            {
                int minCircle = level;
                int maxCircle = (level + 3);
                PackScroll(cont, minCircle, maxCircle);
            }

            // plus "level chances" for magic jewelry & clothing
            switch (level)
            {
            case 0:                     // Adam: trainer chest
            case 1:                     // none
                break;

            case 2:
                PackMagicItem(cont, 1, 1, 0.05);
                break;

            case 3:
                PackMagicItem(cont, 1, 2, 0.10);
                PackMagicItem(cont, 1, 2, 0.05);
                break;

            case 4:
                PackMagicItem(cont, 2, 3, 0.10);
                PackMagicItem(cont, 2, 3, 0.05);
                PackMagicItem(cont, 2, 3, 0.02);
                break;

            case 5:
                PackMagicItem(cont, 3, 3, 0.10);
                PackMagicItem(cont, 3, 3, 0.05);
                PackMagicItem(cont, 3, 3, 0.02);
                break;
            }

            // TreasureMap( int level, Map map
            //	5% chance to get a treasure map
            //  Changed chance for tmap to 1%
            if (level != 0)
            {
                if (Utility.RandomDouble() < 0.01)
                {
                    int mlevel = level;

                    //	20% chance to get a treasure map one level better than the level of this chest
                    if (Utility.RandomDouble() < 0.20)
                    {
                        mlevel += (level < 5) ? 1 : 0;                          // bump up the map level by one
                    }
                    TreasureMap map = new TreasureMap(mlevel, Map.Felucca);
                    cont.DropItem(map);                                                 // drop it baby!
                }
            }

            // if You're doing a level 3, 4, or 5 chest you have a 1.5%, 2%, or 2.5% chance to get a monster statue
            double chance = 0.00 + (((double)level) * 0.005);

            if ((level > 3) && (Utility.RandomDouble() < chance))
            {
                int ndx             = level - 3;
                MonsterStatuette mx =
                    new MonsterStatuette(m_monsters[ndx][Utility.Random(m_monsters[ndx].Length)]);
                mx.LootType = LootType.Regular;                                                 // not blessed
                cont.DropItem(mx);                                                              // drop it baby!
            }

            TreasureMapChest.PackRegs(cont, level * 10);
            TreasureMapChest.PackGems(cont, level * 5);
        }
Exemplo n.º 29
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)]));
			}
		}
Exemplo n.º 30
0
        public static void PackScroll(LockableContainer cont, int circle)
        {
            int min = (circle - 1) * 8;

            cont.DropItem(Loot.RandomScroll(min, min + 7, SpellbookType.Regular));
        }
Exemplo n.º 31
0
        public static void Fill(LockableContainer cont, int luck, int level, bool isSos)
        {
			// Apply Felucca luck bonus
			if (cont.Map == Map.Felucca)
				luck += Mobiles.RandomItemGenerator.FeluccaLuckBonus;

            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, LootPack.GetLuckChance(luck), min, max);

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

            if (level == 0)
            {
                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.Serrure = SerrureQuality.Simple; break;

                case 2: cont.Serrure = SerrureQuality.Moyenne; break;

                case 3: cont.Serrure = SerrureQuality.Bonne; break;

                case 4: cont.Serrure = SerrureQuality.TresBonne; break;

                case 5: cont.Serrure = SerrureQuality.Excellente; break;

                case 6: cont.Serrure = SerrureQuality.Impossible; break;
                }


                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 BaseHat)
                    {
                        BaseHat hat = (BaseHat)item;

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

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

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

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

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

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

                        cont.DropItem(item);
                    }
                }
            }

            int reagents;

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

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

            int gems;

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

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

            if (level == 6 && Core.AOS)
            {
                cont.DropItem((Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]));
            }
        }
Exemplo n.º 33
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;
            int numberItems;

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

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

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

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

                case 2:
                    cont.RequiredSkill = 76;
                    break;

                case 3:
                    cont.RequiredSkill = 84;
                    break;

                case 4:
                    cont.RequiredSkill = 92;
                    break;

                case 5:
                    cont.RequiredSkill = 100;
                    break;

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

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

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

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

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

                    case 2:
                        numberItems = 10;
                        break;

                    case 3:
                        numberItems = 15;
                        break;

                    case 4:
                        numberItems = 38;
                        break;

                    case 5:
                        numberItems = 50;
                        break;

                    case 6:
                        numberItems = 60;
                        break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        cont.DropItem(item);
                    }
                }
            }

            int reagents;

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

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

            int gems;

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

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

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

                        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);
            }
        }
Exemplo n.º 35
0
		public static void PackMagicItem( LockableContainer cont, int minLevel, int maxLevel, double chance )
		{
			if (chance <= Utility.RandomDouble())
				return;

			Item item = Loot.RandomClothingOrJewelry();

			if ( item == null )
				return;

			if ( item is BaseClothing )
				((BaseClothing)item).SetRandomMagicEffect( minLevel, maxLevel );
			else if ( item is BaseJewel )
				((BaseJewel)item).SetRandomMagicEffect( minLevel, maxLevel );

			cont.DropItem( item );
		}
Exemplo n.º 36
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable = false;
            cont.Locked  = true;
            int numberItems;

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

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

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

                cont.RequiredSkill = level switch
                {
                    1 => 36,
                    2 => 76,
                    3 => 84,
                    4 => 92,
                    5 => 100,
                    6 => 100,
                    _ => cont.RequiredSkill
                };

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

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

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

                if (Core.SE)
                {
                    numberItems = level switch
                    {
                        1 => 5,
                        2 => 10,
                        3 => 15,
                        4 => 38,
                        5 => 50,
                        6 => 60,
                        _ => 0
                    };
                }
                else
                {
                    numberItems = level * 6;
                }

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

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

                    if (item is BaseWeapon weapon)
                    {
                        if (Core.AOS)
                        {
                            GetRandomAOSStats(out int attributeCount, out int min, out int 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(weapon);
                    }
                    else if (item is BaseArmor armor)
                    {
                        if (Core.AOS)
                        {
                            GetRandomAOSStats(out int attributeCount, out int min, out int max);
                            BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                        }
                        else
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                            armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(armor);
                    }
                    else if (item is BaseHat hat)
                    {
                        if (Core.AOS)
                        {
                            GetRandomAOSStats(out int attributeCount, out int min, out int max);
                            BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                        }

                        cont.DropItem(hat);
                    }
                    else if (item is BaseJewel jewel)
                    {
                        GetRandomAOSStats(out int attributeCount, out int min, out int max);
                        BaseRunicTool.ApplyAttributesTo(jewel, attributeCount, min, max);

                        cont.DropItem(jewel);
                    }
                }
            }

            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)ActivatorUtil.CreateInstance(Artifacts[Utility.Random(Artifacts.Length)]));
            }
        }
Exemplo n.º 37
0
		private void AddCampChests()
		{
			switch (Utility.Random(3))
			{
				case 0:
					m_Chest = new MetalChest();
					break;
				case 1:
					m_Chest = new MetalGoldenChest();
					break;
				default:
					m_Chest = new WoodenChest();
					break;
			}

			m_Chest.LiftOverride = true;

			AddItem(m_Chest, -2, 2, 0);

			switch (Utility.Random(4))
			{
				case 0:
					m_Crate = new SmallCrate();
					break;
				case 1:
					m_Crate = new MediumCrate();
					break;
				case 2:
					m_Crate = new LargeCrate();
					break;
				default:
					m_Crate = new LockableBarrel();
					break;
			}

			m_Crate.TrapType = TrapType.ExplosionTrap;
			m_Crate.TrapPower = Utility.RandomMinMax(30, 40);
			m_Crate.TrapLevel = 2;

			m_Crate.RequiredSkill = 76;
			m_Crate.LockLevel = 66;
			m_Crate.MaxLockLevel = 116;
			m_Crate.Locked = true;

			m_Crate.DropItem(new Gold(Utility.RandomMinMax(100, 400)));
			m_Crate.DropItem(new Arrow(10));
			m_Crate.DropItem(new Bolt(10));

			m_Crate.LiftOverride = true;

			if (Utility.RandomDouble() < 0.8)
			{
				switch (Utility.Random(4))
				{
					case 0:
						m_Crate.DropItem(new LesserCurePotion());
						break;
					case 1:
						m_Crate.DropItem(new LesserExplosionPotion());
						break;
					case 2:
						m_Crate.DropItem(new LesserHealPotion());
						break;
					default:
						m_Crate.DropItem(new LesserPoisonPotion());
						break;
				}
			}

			AddItem(m_Crate, 2, -2, 0);
		}
Exemplo n.º 38
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 ) ) );

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

                numberItems = level * 6;

                for ( int i = 0; i < numberItems; ++i )
                {
                    LootPack.OldSuperBossMagicItems.Generate( null, cont, true, 100 );
                }
            }

            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 )] ) );
        }