Terraria.Player.openHerbBag C# (CSharp) Method

openHerbBag() public method

public openHerbBag ( ) : void
return void
        public void openHerbBag()
        {
            int num = Main.rand.Next(2, 5);
            if (Main.rand.Next(3) == 0)
                ++num;
            for (int index = 0; index < num; ++index)
            {
                int Type = Main.rand.Next(14);
                if (Type == 0)
                    Type = 313;
                if (Type == 1)
                    Type = 314;
                if (Type == 2)
                    Type = 315;
                if (Type == 3)
                    Type = 317;
                if (Type == 4)
                    Type = 316;
                if (Type == 5)
                    Type = 318;
                if (Type == 6)
                    Type = 2358;
                if (Type == 7)
                    Type = 307;
                if (Type == 8)
                    Type = 308;
                if (Type == 9)
                    Type = 309;
                if (Type == 10)
                    Type = 311;
                if (Type == 11)
                    Type = 310;
                if (Type == 12)
                    Type = 312;
                if (Type == 13)
                    Type = 2357;
                int Stack = Main.rand.Next(2, 5);
                if (Main.rand.Next(3) == 0)
                    Stack += Main.rand.Next(1, 5);
                int number = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Type, Stack, false, 0, false);
                if (Main.netMode == 1)
                    NetMessage.SendData(21, -1, -1, "", number, 1f, 0.0f, 0.0f, 0, 0, 0);
            }
        }
Player