Exemple #1
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);
        }
Exemple #2
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);
        }