示例#1
0
        public override bool CanTownNPCSpawn(int numTownNPCs, int money)
        {
            ReducedGrindingPlayer mPlayer = Main.LocalPlayer.GetModPlayer <ReducedGrindingPlayer>();

            if (mPlayer.clientConf.StationaryMerchant)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public override bool CanTownNPCSpawn(int numTownNPCs, int money)
        {
            ReducedGrindingPlayer mPlayer = Main.LocalPlayer.GetModPlayer <ReducedGrindingPlayer>();

            if (mPlayer.clientConf.ChestSalesmanSpawnable)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public override void ModifyTooltips(Item item, List <TooltipLine> tooltips)
        {
            ReducedGrindingPlayer mPlayer = Main.LocalPlayer.GetModPlayer <ReducedGrindingPlayer>(mod);

            if (mPlayer.clientConf.LootAnkhCharmMaterialIncreasePerAnkhCharmInInventory > 0)
            {
                if (item.type >= 885 && item.type <= 893)                 //All low-tier materials for Ankh Charm.
                {
                    var AnkhMaterialInfo = new TooltipLine(mod, "AnkhMaterialInfo", "Increases the drop rate of \"Ankh Charm\" material.");
                    tooltips.Add(AnkhMaterialInfo);
                }
                if (item.type == ItemID.ArmorBracing)
                {
                    var ArmorBracingInfo = new TooltipLine(mod, "ArmorBracingInfo", "Increases the drop rate of \"Ankh Charm\" material twice.\n" +
                                                           "Cancels the\"Ankh Charm\" material drop rate increase given by \"Vitamins\" and \"Armor Polish\".");
                    tooltips.Add(ArmorBracingInfo);
                }
                if (item.type == ItemID.MedicatedBandage)
                {
                    var MedicatedBandageInfo = new TooltipLine(mod, "MedicatedBandageInfo", "Increases the drop rate of \"Ankh Charm\" material twice.\n" +
                                                               "Cancels the\"Ankh Charm\" material drop rate increase given by \"Adhesive Bandage\" and \"Bezoar\".");
                    tooltips.Add(MedicatedBandageInfo);
                }
                if (item.type == ItemID.CountercurseMantra)
                {
                    var CountercurseMantraInfo = new TooltipLine(mod, "CountercurseMantraInfo", "Increases the drop rate of \"Ankh Charm\" material twice.\n" +
                                                                 "Cancels the\"Ankh Charm\" material drop rate increase given by \"Nazar\" and \"Megaphone\".");
                    tooltips.Add(CountercurseMantraInfo);
                }
                if (item.type == ItemID.ThePlan)
                {
                    var ThePlanInfo = new TooltipLine(mod, "ThePlanInfo", "Increases the drop rate of \"Ankh Charm\" material twice.\n" +
                                                      "Cancels the\"Ankh Charm\" material drop rate increase given by \"Trifold Map\" and \"Fast Clock\".");
                    tooltips.Add(ThePlanInfo);
                }
            }
        }
示例#4
0
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);

            float dropChance = 0f;
            int   testItemID = 0;
            int   chosenID   = 0;

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Cabin Statues
                dropChance = 0.0169f;
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 52;
                }
                for (testItemID = 438; testItemID <= 441; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 443;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 446;
                }
                for (testItemID = 448; testItemID <= 455; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 457; testItemID <= 463; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 465; testItemID <= 473; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 475; testItemID <= 478; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 2672;
                }
                for (testItemID = 3708; testItemID <= 3720; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (chosenID != 476 && chosenID != 477 && Main.rand.Next(10) == 0)                 //10% chance of being king or queen statue
                {
                    player.QuickSpawnItem(Main.rand.Next(476, 478));
                }
                else
                {
                    player.QuickSpawnItem(chosenID);
                }
                chosenID = 0;

                //Cabin Paintings
                dropChance = 0.0067f;                 //About 0.1 paintings when rolling 1 time for 15 paintings
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1427;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1428;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1442;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1443;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1474;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1480;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1495;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1496;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1498;
                }
                for (testItemID = 1574; testItemID <= 1577; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                player.QuickSpawnItem(chosenID);
                chosenID = 0;

                //Undereground Jungle Cabin Sharpening Station
                if (Main.rand.Next(5) <= 1)
                {
                    player.QuickSpawnItem(3198, 1);                     //Sharpening Station
                }
            }

            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                float itemroll = Main.rand.NextFloat();

                //Ivy Chest Primary Items
                if (itemroll < 0.225f)
                {
                    player.QuickSpawnItem(212, 1);                     //Anklet of the Wind
                }
                else if (itemroll < 0.45f)
                {
                    player.QuickSpawnItem(211, 1);                     //Feral Claws
                }
                else if (itemroll < 0.675f)
                {
                    player.QuickSpawnItem(213, 1);                     //Staff of Regrowth
                }
                else if (itemroll < 0.9f)
                {
                    player.QuickSpawnItem(964, 1);                     //Boomstick
                }
                else if (itemroll < 0.92f)
                {
                    player.QuickSpawnItem(964, 1);                     //Seaweed
                }
                else if (itemroll < 0.953f)
                {
                    player.QuickSpawnItem(2292, 1);                     //Fiberglass Fishing Pole
                }
                else
                {
                    player.QuickSpawnItem(3017, 1);                     //Flower Boots
                }
                //Ivy Chest Secondary Items
                if (Main.rand.Next(6) == 0)
                {
                    player.QuickSpawnItem(3360, 1);                     //Living Mahogany Wand
                    player.QuickSpawnItem(3361, 1);                     //Living Mahogany Leaf Wand
                }
                if (Main.rand.Next(4) == 0)
                {
                    player.QuickSpawnItem(2204, 1);                     //Honey Dispenser
                }
                //Cavern Gold Chest Common Items
                if (Main.rand.Next(5) == 0)
                {
                    player.QuickSpawnItem(43, 1);                     //Suspicious Looking Eye
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(167, 1);                     //Dynamite
                }
                if (Main.rand.Next(4) == 0)
                {
                    player.QuickSpawnItem(51, Main.rand.Next(25, 51));                     //Jester's Arrow
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(4))
                    {
                    case 0:
                        chosenID = WorldGen.silverBar;
                        break;

                    case 1:
                        chosenID = WorldGen.goldBar;
                        break;

                    default:
                        chosenID = 0;
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(3, 11));
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        chosenID = 41;                                 //Flaming Arrow
                        break;

                    case 1:
                        chosenID = 279;                                 //Throwing Knife
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(25, 51));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(188, Main.rand.Next(3, 6));                     //Healing Potion
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        chosenID = 296;                                 //Spelunker Potion
                        break;

                    case 1:
                        chosenID = 295;                                 //Featherfall Potion
                        break;

                    case 2:
                        chosenID = 299;                                 //Night Owl Potion
                        break;

                    case 3:
                        chosenID = 302;                                 //Water Walking Potion
                        break;

                    case 4:
                        chosenID = 303;                                 //Archery Potion
                        break;

                    case 5:
                        chosenID = 305;                                 //Gravitation Potion
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(1, 3));
                }
                else
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        chosenID = 301;                                 //Thorns Potion
                        break;

                    case 1:
                        chosenID = 302;                                 //Water Walking Potion
                        break;

                    case 2:
                        chosenID = 297;                                 //Invisiblity Potion
                        break;

                    case 3:
                        chosenID = 304;                                 //Hunter Potion
                        break;

                    case 4:
                        chosenID = 2329;                                 //Dangersense Potion
                        break;

                    case 5:
                        chosenID = 2351;                                 //Teleportation Potion
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(2350, Main.rand.Next(1, 3));                     //Recal Potion
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        chosenID = 8;                                 //Torch
                        break;

                    case 1:
                        chosenID = 282;                                 //Glowstick
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(15, 30));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(73, Main.rand.Next(2, 3));                     //Gold Coin
                }
            }
        }
        public override void SetupShop(Chest shop, ref int nextSlot)
        {
            ReducedGrindingPlayer mPlayer = Main.LocalPlayer.GetModPlayer <ReducedGrindingPlayer>();

            shop.item[nextSlot].SetDefaults(48); //Default Chest
            nextSlot++;
            if (Main.hardMode || !GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanPreHardmodeChestsRequireHardmodeActivated)
            {
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsGoldChest)
                {
                    shop.item[nextSlot].SetDefaults(306);
                    nextSlot++;
                }
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsIceChest&& (NPC.downedBoss1 || Main.hardMode))                  //Eye of Cthulhu
                {
                    shop.item[nextSlot].SetDefaults(681);
                    nextSlot++;
                }
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsIvyChest&& (NPC.downedBoss2 || Main.hardMode))                  //Eater of Worlds or Brain of Cthulhu
                {
                    shop.item[nextSlot].SetDefaults(680);
                    nextSlot++;
                }
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsLivingWoodChest)
                {
                    shop.item[nextSlot].SetDefaults(831);
                    nextSlot++;
                }
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsSkywareChest&& (NPC.downedBoss2 || Main.hardMode))
                {
                    shop.item[nextSlot].SetDefaults(838);
                    nextSlot++;
                }
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsOceanChest)
                {
                    shop.item[nextSlot].SetDefaults(1298);
                    nextSlot++;
                }
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsWebCoveredChest&& (NPC.downedBoss1 || Main.hardMode))
                {
                    shop.item[nextSlot].SetDefaults(952);
                    nextSlot++;
                }
                if (GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsShadowChest&& (NPC.downedBoss3 || Main.hardMode)) //Skeletron
                {
                    shop.item[nextSlot].SetDefaults(328);                                                                      //Shadow Chest
                    nextSlot++;
                }
            }
            if (NPC.downedGolemBoss && GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsLihzahrdChest)
            {
                shop.item[nextSlot].SetDefaults(1142);                 //Lihzahrd Chest
                nextSlot++;
            }
            if (NPC.downedPlantBoss && GetInstance <IOtherCustomNPCsConfig>().ChestSalesmanSellsBiomeChests)
            {            //Dungeon Chest
                shop.item[nextSlot].SetDefaults(1529);
                nextSlot++;
                shop.item[nextSlot].SetDefaults(1530);
                nextSlot++;
                shop.item[nextSlot].SetDefaults(1531);
                nextSlot++;
                shop.item[nextSlot].SetDefaults(1532);
                nextSlot++;
                shop.item[nextSlot].SetDefaults(1528);
                nextSlot++;
            }
        }
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);

            int itemid = 0;

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Floating Island Banners
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(845, 1);                     //World Banner
                }
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(846, 1);                     //Sun Banner
                }
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(847, 1);                     //Gravity Banner
                }
            }

            //Skyware Chest Items
            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                switch (Main.rand.Next(3))
                {
                case 0:
                    player.QuickSpawnItem(159, 1);                             //Shiny Red Balloon
                    break;

                case 1:
                    player.QuickSpawnItem(65, 1);                             //Starfury
                    break;

                case 2:
                    player.QuickSpawnItem(158);                             //Lucky Horseshoe
                    break;
                }
            }
            if (Main.rand.Next(3) == 0 && mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                player.QuickSpawnItem(2197, 1);                 //Skymill
            }
            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                //Surface Chest Common Items
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(168, Main.rand.Next(3, 6));                     //Grenade
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = WorldGen.copperBar;
                        break;

                    case 1:
                        itemid = WorldGen.ironBar;
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(3, 11));
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 40;                                 //Arrow
                        break;

                    case 1:
                        itemid = 42;                                 //Shuriken
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(25, 51));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(28, Main.rand.Next(3, 6));                     //Lesser Healing Potion
                }
                if (Main.rand.Next(2) <= 1)
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        itemid = 292;                                 //Ironskin Potion
                        break;

                    case 1:
                        itemid = 298;                                 //Shine Potion
                        break;

                    case 2:
                        itemid = 299;                                 //Night Owl Potion
                        break;

                    case 3:
                        itemid = 290;                                 //Swiftness Potion
                        break;

                    case 4:
                        itemid = 2322;                                 //Mining Potion
                        break;

                    case 5:
                        itemid = 2325;                                 //Builder Potion
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 8;                                 //Torch
                        break;

                    case 1:
                        itemid = 31;                                 //Bottle
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(10, 21));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(965, Main.rand.Next(50, 101));                     //Rope
                }
                if (Main.rand.Next(6) == 0)
                {
                    player.QuickSpawnItem(3093, Main.rand.Next(1, 5));                     //Herb Bag
                }
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(2350, Main.rand.Next(2, 5));                     //Recall Potion
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(72, Main.rand.Next(10, 30));                     //Silver Coins
                }
            }
        }
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);

            float dropChance = 0f;
            int   testItemID = 0;
            int   chosenID   = 0;
            int   itemid     = 0;

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Cabin Statues
                dropChance = 0.0169f;
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 52;
                }
                for (testItemID = 438; testItemID <= 441; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 443;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 446;
                }
                for (testItemID = 448; testItemID <= 455; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 457; testItemID <= 463; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 465; testItemID <= 473; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 475; testItemID <= 478; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 2672;
                }
                for (testItemID = 3708; testItemID <= 3720; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (chosenID != 476 && chosenID != 477 && Main.rand.Next(10) == 0)                 //10% chance of being king or queen statue
                {
                    player.QuickSpawnItem(Main.rand.Next(476, 478));
                }
                else
                {
                    player.QuickSpawnItem(chosenID);
                }
                chosenID = 0;

                //Cabin Paintings
                dropChance = 0.0067f;                 //About 0.1 paintings when rolling 1 time for 15 paintings
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1427;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1428;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1442;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1443;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1474;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1480;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1495;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1496;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1498;
                }
                for (testItemID = 1574; testItemID <= 1577; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                player.QuickSpawnItem(chosenID);
                chosenID = 0;
            }

            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                //Underground Rare Items
                if (Main.rand.Next(20) == 0)
                {
                    player.QuickSpawnItem(ItemID.Extractinator);
                }
                else
                {
                    switch (Main.rand.Next(7))
                    {
                    case 0:
                        player.QuickSpawnItem(49, 1);                                 //Band of Regeneration
                        break;

                    case 1:
                        player.QuickSpawnItem(50, 1);                                 //Magic Mirror
                        break;

                    case 2:
                        player.QuickSpawnItem(53, 1);                                 //Cloud in a Bottle
                        break;

                    case 3:
                        player.QuickSpawnItem(54, 1);                                 //Hermes Boots
                        break;

                    case 4:
                        player.QuickSpawnItem(55, 1);                                 //Enchanted Boomerang
                        break;

                    case 5:
                        player.QuickSpawnItem(975, 1);                                 //Shoe Spikes
                        break;

                    case 6:
                        player.QuickSpawnItem(930);                                 //Flare Gun
                        player.QuickSpawnItem(931, Main.rand.Next(25, 51));         //Flares
                        break;
                    }
                }

                //Underground Chest Common Items
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(166, Main.rand.Next(10, 20));                     //Bomb
                }
                if (Main.rand.Next(5) == 0)
                {
                    player.QuickSpawnItem(52, 1);                     //Angel Statue
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(965, Main.rand.Next(50, 101));                     //Rope
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = WorldGen.ironBar;
                        break;

                    case 1:
                        itemid = WorldGen.silverBar;
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(5, 15));
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 40;                                 //Arrow
                        break;

                    case 1:
                        itemid = 42;                                 //Shuriken
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(25, 51));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(28, Main.rand.Next(3, 6));                     //Lesser Healing Potion
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(9))
                    {
                    case 0:
                        itemid = 289;                                 //Regeneration Potion
                        break;

                    case 1:
                        itemid = 298;                                 //Shine Potion
                        break;

                    case 2:
                        itemid = 299;                                 //Night Owl Potion
                        break;

                    case 3:
                        itemid = 290;                                 //Swiftness Potion
                        break;

                    case 4:
                        itemid = 303;                                 //Archery Potion
                        break;

                    case 5:
                        itemid = 291;                                 //Gills Potion
                        break;

                    case 6:
                        itemid = 304;                                 //Hunter Potion
                        break;

                    case 7:
                        itemid = 2322;                                 //Mining Potion
                        break;

                    case 8:
                        itemid = 2329;                                 //Dangersense Potion
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(8, Main.rand.Next(10, 21));                     //Torch
                }
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(2350, Main.rand.Next(1, 3));                     //Recall Potion
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(72, Main.rand.Next(50, 90));                     //Silver Coins
                }
            }
        }
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);

            int   itemid   = 0;
            float itemroll = Main.rand.NextFloat();

            player.QuickSpawnItem(ItemID.LihzahrdBrick, Main.rand.Next(10, 21));

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Lihzahrd Temple Statues
                player.QuickSpawnItem(Main.rand.Next(1152, 1155));
            }

            //Lihzahrd Chest Primary Items
            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                player.QuickSpawnItem(2195, 1);                 //Lihzahrd Furnace
            }
            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                player.QuickSpawnItem(1293, 1);                 //Lihzahrd Power Cell
                if (Main.rand.Next(5) == 0)
                {
                    player.QuickSpawnItem(2767, 1);                     //Solar Tablet
                }
                else
                {
                    player.QuickSpawnItem(2766, 1);                     //Solar Tablet Fragment
                }
            }

            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                //Cavern Gold Chest Common Items
                if (Main.rand.Next(5) == 0)
                {
                    player.QuickSpawnItem(43, 1);                     //Suspicious Looking Eye
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(167, 1);                     //Dynamite
                }
                if (Main.rand.Next(4) == 0)
                {
                    player.QuickSpawnItem(51, Main.rand.Next(25, 51));                     //Jester's Arrow
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(4))
                    {
                    case 0:
                        itemid = WorldGen.silverBar;
                        break;

                    case 1:
                        itemid = WorldGen.goldBar;
                        break;

                    default:
                        itemid = 0;
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(3, 11));
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 41;                                 //Flaming Arrow
                        break;

                    case 1:
                        itemid = 279;                                 //Throwing Knife
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(25, 51));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(188, Main.rand.Next(3, 6));                     //Healing Potion
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        itemid = 296;                                 //Spelunker Potion
                        break;

                    case 1:
                        itemid = 295;                                 //Featherfall Potion
                        break;

                    case 2:
                        itemid = 299;                                 //Night Owl Potion
                        break;

                    case 3:
                        itemid = 302;                                 //Water Walking Potion
                        break;

                    case 4:
                        itemid = 303;                                 //Archery Potion
                        break;

                    case 5:
                        itemid = 305;                                 //Gravitation Potion
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(1, 3));
                }
                else
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        itemid = 301;                                 //Thorns Potion
                        break;

                    case 1:
                        itemid = 302;                                 //Water Walking Potion
                        break;

                    case 2:
                        itemid = 297;                                 //Invisiblity Potion
                        break;

                    case 3:
                        itemid = 304;                                 //Hunter Potion
                        break;

                    case 4:
                        itemid = 2329;                                 //Dangersense Potion
                        break;

                    case 5:
                        itemid = 2351;                                 //Teleportation Potion
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(2350, Main.rand.Next(1, 3));                     //Recal Potion
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 8;                                 //Torch
                        break;

                    case 1:
                        itemid = 282;                                 //Glowstick
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(15, 30));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(73, Main.rand.Next(2, 3));                     //Gold Coin
                }
            }
        }
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);
            int itemid = 0;

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Pyramid Banners
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(789, 1);                     //Ankh Banner
                }
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(790, 1);                     //Snake Banner
                }
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(791, 1);                     //Omega Banner
                }
            }

            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                //Pyramid Gold Chest Items
                switch (Main.rand.Next(3))
                {
                case 0:
                    player.QuickSpawnItem(857, 1);                             //Sandstorm in a Bottle
                    break;

                case 1:
                    player.QuickSpawnItem(848, 1);                             //Pharaoh's Mask
                    player.QuickSpawnItem(866, 1);                             //Pharaoh's Robe
                    break;

                case 2:
                    player.QuickSpawnItem(934);                             //Flying Carpet
                    break;
                }

                //Cavern Gold Chest Common Items
                if (Main.rand.Next(5) == 0)
                {
                    player.QuickSpawnItem(43, 1);                     //Suspicious Looking Eye
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(167, 1);                     //Dynamite
                }
                if (Main.rand.Next(4) == 0)
                {
                    player.QuickSpawnItem(51, Main.rand.Next(25, 51));                     //Jester's Arrow
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(4))
                    {
                    case 0:
                        itemid = WorldGen.silverBar;
                        break;

                    case 1:
                        itemid = WorldGen.goldBar;
                        break;

                    default:
                        itemid = 0;
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(3, 11));
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 41;                                 //Flaming Arrow
                        break;

                    case 1:
                        itemid = 279;                                 //Throwing Knife
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(25, 51));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(188, Main.rand.Next(3, 6));                     //Healing Potion
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        itemid = 296;                                 //Spelunker Potion
                        break;

                    case 1:
                        itemid = 295;                                 //Featherfall Potion
                        break;

                    case 2:
                        itemid = 299;                                 //Night Owl Potion
                        break;

                    case 3:
                        itemid = 302;                                 //Water Walking Potion
                        break;

                    case 4:
                        itemid = 303;                                 //Archery Potion
                        break;

                    case 5:
                        itemid = 305;                                 //Gravitation Potion
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(1, 3));
                }
                else
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        itemid = 301;                                 //Thorns Potion
                        break;

                    case 1:
                        itemid = 302;                                 //Water Walking Potion
                        break;

                    case 2:
                        itemid = 297;                                 //Invisiblity Potion
                        break;

                    case 3:
                        itemid = 304;                                 //Hunter Potion
                        break;

                    case 4:
                        itemid = 2329;                                 //Dangersense Potion
                        break;

                    case 5:
                        itemid = 2351;                                 //Teleportation Potion
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(2350, Main.rand.Next(1, 3));                     //Recal Potion
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 8;                                 //Torch
                        break;

                    case 1:
                        itemid = 282;                                 //Glowstick
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(15, 30));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(73, Main.rand.Next(2, 3));                     //Gold Coin
                }
            }
        }
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);

            float dropChance = 0f;
            int   testItemID = 0;
            int   chosenID   = 0;

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Ruined House Banners
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(1464, 1);                     //Hellhound Banner
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(1465, 1);                     //Hell Hammer Banner
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(1466, 1);                     //Hell Tower Banner
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(1467, 1);                     //Lost Hopes Banner
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(1468, 1);                     //Obsidian Watcher Banner
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(1469, 1);                     //Lava Erupts Banner
                }
                //Ruined House Furniture
                if (Main.rand.Next(5) == 0)
                {
                    player.QuickSpawnItem(221, 1);                     //Hellforge
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(433, Main.rand.Next(5, 11)); //Demon Torch
                }
                dropChance = 0.04f;                                    //About 4 furniture for rollng 5 times for 20 furnitures.
                for (int i = 0; i <= 4; i++)                           //Other Furniture
                {
                    for (testItemID = 1457; testItemID <= 1463; testItemID++)
                    {
                        if (Main.rand.NextFloat() < dropChance)
                        {
                            chosenID = testItemID;
                        }
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1473;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2380;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2390;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2406;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2600;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2618;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2642;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2644;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2651;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2657;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2662;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2667;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 2840;
                    }
                    player.QuickSpawnItem(chosenID);
                    chosenID = 0;
                }

                //Ruined House Paintings
                dropChance = 0.0556f;                 //About 2 paintings when rolling 3 times for 12 paintings
                for (int i = 0; i <= 2; i++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1475;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1476;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1478;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1479;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1497;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1499;
                    }
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = 1501;
                    }
                    for (testItemID = 1538; testItemID <= 1542; testItemID++)
                    {
                        if (Main.rand.NextFloat() < dropChance)
                        {
                            chosenID = testItemID;
                        }
                    }
                    player.QuickSpawnItem(chosenID);
                    chosenID = 0;
                }
            }

            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                //Shadow Lock Box Rare Items
                switch (Main.rand.Next(5))
                {
                case 0:
                    player.QuickSpawnItem(ItemID.DarkLance, 1);
                    break;

                case 1:
                    player.QuickSpawnItem(ItemID.Flamelash, 1);
                    break;

                case 2:
                    player.QuickSpawnItem(ItemID.FlowerofFire, 1);
                    break;

                case 3:
                    player.QuickSpawnItem(ItemID.Sunfury, 1);
                    break;

                case 4:
                    player.QuickSpawnItem(ItemID.HellwingBow, 1);
                    break;
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(ItemID.Dynamite, 1);
                }
                if (Main.rand.Next(2) == 0)
                {
                    if (Main.rand.Next(1) == 0)
                    {
                        player.QuickSpawnItem(ItemID.MeteoriteBar, Main.rand.Next(15, 30));                         //First number in inclusive, 2nd is exclusive
                    }
                    else
                    {
                        player.QuickSpawnItem(WorldGen.goldBar, Main.rand.Next(15, 30));
                    }
                }
                if (Main.rand.Next(2) == 0)
                {
                    if (Main.rand.Next(1) == 0)
                    {
                        player.QuickSpawnItem(ItemID.HellfireArrow, Main.rand.Next(50, 75));
                    }
                    else
                    {
                        player.QuickSpawnItem(ItemID.SilverBullet, Main.rand.Next(50, 75));
                    }
                }
                if (Main.rand.Next(2) == 0)
                {
                    if (Main.rand.Next(1) == 0)
                    {
                        player.QuickSpawnItem(ItemID.LesserRestorationPotion, Main.rand.Next(15, 21));
                    }
                    else
                    {
                        player.QuickSpawnItem(ItemID.RestorationPotion, Main.rand.Next(15, 21));
                    }
                }
                if (Main.rand.Next(4) <= 2)
                {
                    switch (Main.rand.Next(8))
                    {
                    case 0:
                        player.QuickSpawnItem(ItemID.SpelunkerPotion, Main.rand.Next(1, 3));
                        break;

                    case 1:
                        player.QuickSpawnItem(ItemID.FeatherfallPotion, Main.rand.Next(1, 3));
                        break;

                    case 2:
                        player.QuickSpawnItem(ItemID.ManaRegenerationPotion, Main.rand.Next(1, 3));
                        break;

                    case 3:
                        player.QuickSpawnItem(ItemID.ObsidianSkinPotion, Main.rand.Next(1, 3));
                        break;

                    case 4:
                        player.QuickSpawnItem(ItemID.MagicPowerPotion, Main.rand.Next(1, 3));
                        break;

                    case 5:
                        player.QuickSpawnItem(ItemID.InvisibilityPotion, Main.rand.Next(1, 3));
                        break;

                    case 6:
                        player.QuickSpawnItem(ItemID.HunterPotion, Main.rand.Next(1, 3));
                        break;

                    case 7:
                        player.QuickSpawnItem(ItemID.HeartreachPotion, Main.rand.Next(1, 3));
                        break;
                    }
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(8))
                    {
                    case 0:
                        player.QuickSpawnItem(ItemID.GravitationPotion, Main.rand.Next(1, 3));
                        break;

                    case 1:
                        player.QuickSpawnItem(ItemID.ThornsPotion, Main.rand.Next(1, 3));
                        break;

                    case 2:
                        player.QuickSpawnItem(ItemID.WaterWalkingPotion, Main.rand.Next(1, 3));
                        break;

                    case 3:
                        player.QuickSpawnItem(ItemID.ObsidianSkinPotion, Main.rand.Next(1, 3));
                        break;

                    case 4:
                        player.QuickSpawnItem(ItemID.BattlePotion, Main.rand.Next(1, 3));
                        break;

                    case 5:
                        player.QuickSpawnItem(ItemID.TeleportationPotion, Main.rand.Next(1, 3));
                        break;

                    case 6:
                        player.QuickSpawnItem(ItemID.InfernoPotion, Main.rand.Next(1, 3));
                        break;

                    case 7:
                        player.QuickSpawnItem(ItemID.LifeforcePotion, Main.rand.Next(1, 3));
                        break;
                    }
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(ItemID.RecallPotion, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    if (Main.rand.Next(1) == 0)
                    {
                        player.QuickSpawnItem(ItemID.Torch, Main.rand.Next(15, 30));
                    }
                    else
                    {
                        player.QuickSpawnItem(ItemID.Glowstick, Main.rand.Next(15, 30));
                    }
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(ItemID.GoldCoin, Main.rand.Next(2, 5));
                }
            }
        }
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);
            int itemid = 0;

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Living Wood Chest Items
                switch (Main.rand.Next(3))
                {
                case 0:
                    player.QuickSpawnItem(832, 1);                             //Living Wood Wand
                    break;

                case 1:
                    player.QuickSpawnItem(933, 1);                             //Leaf Wand
                    break;

                case 2:
                    player.QuickSpawnItem(2196, 1);                             //Living Loom
                    break;
                }
            }

            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                //Surface Chest Rare Items
                switch (Main.rand.Next(11))
                {
                case 0:
                    player.QuickSpawnItem(280, 1);                             //Spear
                    break;

                case 1:
                    player.QuickSpawnItem(284, 1);                             //Boomerang
                    break;

                case 2:
                    player.QuickSpawnItem(281, 1);                             //Blowpipe
                    break;

                case 3:
                    player.QuickSpawnItem(282, Main.rand.Next(40, 75));                             //Glowstick
                    break;

                case 4:
                    player.QuickSpawnItem(279, Main.rand.Next(70, 150));                             //Throwing Knife
                    break;

                case 5:
                    player.QuickSpawnItem(285, 1);                             //Aglet
                    break;

                case 6:
                    player.QuickSpawnItem(953, 1);                             //Climbing Claws
                    break;

                case 7:
                    player.QuickSpawnItem(946, 1);                             //Umbrella
                    break;

                case 8:
                    player.QuickSpawnItem(3084, 1);                             //Radar
                    break;

                case 9:
                    player.QuickSpawnItem(3068, 1);                             //Guide to Plant Fiber Cordage
                    break;

                case 10:
                    player.QuickSpawnItem(3069, 1);                             //Wand of Sparking
                    break;
                }

                //Surface Chest Common Items
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(168, Main.rand.Next(3, 6));                     //Grenade
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = WorldGen.copperBar;
                        break;

                    case 1:
                        itemid = WorldGen.ironBar;
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(3, 11));
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 40;                                 //Arrow
                        break;

                    case 1:
                        itemid = 42;                                 //Shuriken
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(25, 51));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(28, Main.rand.Next(3, 6));                     //Lesser Healing Potion
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        itemid = 292;                                 //Ironskin Potion
                        break;

                    case 1:
                        itemid = 298;                                 //Shine Potion
                        break;

                    case 2:
                        itemid = 299;                                 //Night Owl Potion
                        break;

                    case 3:
                        itemid = 290;                                 //Swiftness Potion
                        break;

                    case 4:
                        itemid = 2322;                                 //Mining Potion
                        break;

                    case 5:
                        itemid = 2325;                                 //Builder Potion
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        itemid = 8;                                 //Torch
                        break;

                    case 1:
                        itemid = 31;                                 //Bottle
                        break;
                    }
                    player.QuickSpawnItem(itemid, Main.rand.Next(10, 21));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(965, Main.rand.Next(50, 101));                     //Rope
                }
                if (Main.rand.Next(6) == 0)
                {
                    player.QuickSpawnItem(3093, Main.rand.Next(1, 5));                     //Herb Bag
                }
                if (Main.rand.Next(3) <= 1)
                {
                    player.QuickSpawnItem(2350, Main.rand.Next(2, 5));                     //Recall Potion
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(72, Main.rand.Next(10, 30));                     //Silver Coins
                }
            }
        }
        public override void RightClick(Player player)
        {
            ReducedGrindingPlayer mPlayer = player.GetModPlayer <ReducedGrindingPlayer>(mod);

            float dropChance = 0f;
            int   testItemID = 0;
            int   chosenID   = 0;

            if (mPlayer.clientConf.LockBoxesGiveFurniture)
            {
                //Cabin Statues
                dropChance = 0.0169f;
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 52;
                }
                for (testItemID = 438; testItemID <= 441; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 443;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 446;
                }
                for (testItemID = 448; testItemID <= 455; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 457; testItemID <= 463; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 465; testItemID <= 473; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                for (testItemID = 475; testItemID <= 478; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 2672;
                }
                for (testItemID = 3708; testItemID <= 3720; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                if (chosenID != 476 && chosenID != 477 && Main.rand.Next(10) == 0)                 //10% chance of being king or queen statue
                {
                    player.QuickSpawnItem(Main.rand.Next(476, 478));
                }
                else
                {
                    player.QuickSpawnItem(chosenID);
                }
                chosenID = 0;

                //Cabin Paintings
                dropChance = 0.0067f;                 //About 0.1 paintings when rolling 1 time for 15 paintings
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1427;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1428;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1442;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1443;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1474;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1480;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1495;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1496;
                }
                if (Main.rand.NextFloat() < dropChance)
                {
                    chosenID = 1498;
                }
                for (testItemID = 1574; testItemID <= 1577; testItemID++)
                {
                    if (Main.rand.NextFloat() < dropChance)
                    {
                        chosenID = testItemID;
                    }
                }
                player.QuickSpawnItem(chosenID);
                chosenID = 0;
            }

            if (mPlayer.clientConf.LockBoxesGiveNonFurniture)
            {
                //Cavern Rare Items
                if (Main.rand.Next(40) == 0)
                {
                    player.QuickSpawnItem(906, 1);                     //Lava Charm
                }
                else if (Main.rand.Next(15) == 0)
                {
                    player.QuickSpawnItem(997, 1);                     //Extractinator
                }
                else
                {
                    switch (Main.rand.Next(7))
                    {
                    case 0:
                        player.QuickSpawnItem(49, 1);                                 //Band of Regeneration
                        break;

                    case 1:
                        player.QuickSpawnItem(50, 1);                                 //Magic Mirror
                        break;

                    case 2:
                        player.QuickSpawnItem(53, 1);                                 //Cloud in a Bottle
                        break;

                    case 3:
                        player.QuickSpawnItem(54, 1);                                 //Hermes Boots
                        break;

                    case 4:
                        player.QuickSpawnItem(55, 1);                                 //Enchanted Boomerang
                        break;

                    case 5:
                        player.QuickSpawnItem(975, 1);                                 //Shoe Spikes
                        break;

                    case 6:
                        player.QuickSpawnItem(930);                                 //Flare Gun
                        player.QuickSpawnItem(931, Main.rand.Next(25, 51));         //Flares
                        break;
                    }
                }

                //Cavern Gold Chest Common Items
                if (Main.rand.Next(5) == 0)
                {
                    player.QuickSpawnItem(43, 1);                     //Suspicious Looking Eye
                }
                if (Main.rand.Next(3) == 0)
                {
                    player.QuickSpawnItem(167, 1);                     //Dynamite
                }
                if (Main.rand.Next(4) == 0)
                {
                    player.QuickSpawnItem(51, Main.rand.Next(25, 51));                     //Jester's Arrow
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(4))
                    {
                    case 0:
                        chosenID = WorldGen.silverBar;
                        break;

                    case 1:
                        chosenID = WorldGen.goldBar;
                        break;

                    default:
                        chosenID = 0;
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(3, 11));
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        chosenID = 41;                                 //Flaming Arrow
                        break;

                    case 1:
                        chosenID = 279;                                 //Throwing Knife
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(25, 51));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(188, Main.rand.Next(3, 6));                     //Healing Potion
                }
                if (Main.rand.Next(3) <= 1)
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        chosenID = 296;                                 //Spelunker Potion
                        break;

                    case 1:
                        chosenID = 295;                                 //Featherfall Potion
                        break;

                    case 2:
                        chosenID = 299;                                 //Night Owl Potion
                        break;

                    case 3:
                        chosenID = 302;                                 //Water Walking Potion
                        break;

                    case 4:
                        chosenID = 303;                                 //Archery Potion
                        break;

                    case 5:
                        chosenID = 305;                                 //Gravitation Potion
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(1, 3));
                }
                else
                {
                    switch (Main.rand.Next(6))
                    {
                    case 0:
                        chosenID = 301;                                 //Thorns Potion
                        break;

                    case 1:
                        chosenID = 302;                                 //Water Walking Potion
                        break;

                    case 2:
                        chosenID = 297;                                 //Invisiblity Potion
                        break;

                    case 3:
                        chosenID = 304;                                 //Hunter Potion
                        break;

                    case 4:
                        chosenID = 2329;                                 //Dangersense Potion
                        break;

                    case 5:
                        chosenID = 2351;                                 //Teleportation Potion
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(1, 3));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(2350, Main.rand.Next(1, 3));                     //Recal Potion
                }
                if (Main.rand.Next(2) == 0)
                {
                    switch (Main.rand.Next(2))
                    {
                    case 0:
                        chosenID = 8;                                 //Torch
                        break;

                    case 1:
                        chosenID = 282;                                 //Glowstick
                        break;
                    }
                    player.QuickSpawnItem(chosenID, Main.rand.Next(15, 30));
                }
                if (Main.rand.Next(2) == 0)
                {
                    player.QuickSpawnItem(73, Main.rand.Next(2, 3));                     //Gold Coin
                }
            }
        }