Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OpenLockBox()

void Terraria.Player.OpenLockBox ( int lockboxItemType)
inline

Definition at line 8583 of file Player.cs.

8584 {
8585 bool flag = true;
8587 while (flag)
8588 {
8589 flag = false;
8590 int num = 0;
8591 int number = Item.NewItem(Type: Main.rand.Next(7) switch
8592 {
8593 1 => 3317,
8594 2 => 155,
8595 3 => 156,
8596 4 => (!Main.remixWorld) ? 157 : 2623,
8597 5 => 163,
8598 6 => 113,
8599 _ => 164,
8600 }, source: itemSource_OpenItem, X: (int)position.X, Y: (int)position.Y, Width: width, Height: height, Stack: 1, noBroadcast: false, pfix: -1);
8601 if (Main.netMode == 1)
8602 {
8603 NetMessage.SendData(21, -1, -1, null, number, 1f);
8604 }
8605 if (Main.rand.Next(3) == 0)
8606 {
8607 int number2 = Item.NewItem(itemSource_OpenItem, (int)position.X, (int)position.Y, width, height, 329, 1, noBroadcast: false, -1);
8608 if (Main.netMode == 1)
8609 {
8610 NetMessage.SendData(21, -1, -1, null, number2, 1f);
8611 }
8612 }
8613 }
8614 }
Vector2 position
Definition Entity.cs:14
IEntitySource GetItemSource_OpenItem(int itemType)
Definition Player.cs:9277

References Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Main.rand, Terraria.Main.remixWorld, Terraria.NetMessage.SendData(), System.source, System.X, and System.Y.

Referenced by Terraria.UI.ItemSlot.TryOpenContainer().