Terraria.Player.DropCoins C# (CSharp) Method

DropCoins() public method

public DropCoins ( ) : int
return int
        public int DropCoins()
        {
            int num1 = 0;
            for (int index = 0; index < 59; ++index)
            {
                if (this.inventory[index].itemId >= 71 && this.inventory[index].itemId <= 74)
                {
                    int number = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, this.inventory[index].itemId, 1, false, 0, false);
                    int num2 = this.inventory[index].stack / 2;
                    if (Main.expertMode)
                        num2 = (int)((double)this.inventory[index].stack * 0.25);
                    int num3 = this.inventory[index].stack - num2;
                    this.inventory[index].stack -= num3;
                    if (this.inventory[index].itemId == 71)
                        num1 += num3;
                    if (this.inventory[index].itemId == 72)
                        num1 += num3 * 100;
                    if (this.inventory[index].itemId == 73)
                        num1 += num3 * 10000;
                    if (this.inventory[index].itemId == 74)
                        num1 += num3 * 1000000;
                    if (this.inventory[index].stack <= 0)
                        this.inventory[index] = new Item();
                    Main.item[number].stack = num3;
                    Main.item[number].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
                    Main.item[number].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f;
                    Main.item[number].noGrabDelay = 100;
                    if (Main.netMode == 1)
                        NetMessage.SendData(21, -1, -1, "", number, 0.0f, 0.0f, 0.0f, 0, 0, 0);
                    if (index == 58)
                        Main.mouseItem = this.inventory[index].Clone();
                }
            }
            this.lostCoins = num1;
            this.lostCoinString = Main.ValueToCoins(this.lostCoins);
            return num1;
        }
Player