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

◆ DropItemInstanced()

void Terraria.NPC.DropItemInstanced ( Vector2 Position,
Vector2 HitboxSize,
int itemType,
int itemStack = 1,
bool interactionRequired = true )
inline

Definition at line 85577 of file NPC.cs.

85578 {
85579 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
85580 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
85581 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
85582 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
85583 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
85584 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
85585 //IL_00be: Unknown result type (might be due to invalid IL or missing references)
85586 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
85587 if (itemType <= 0)
85588 {
85589 return;
85590 }
85591 if (Main.netMode == 2)
85592 {
85593 int num = Item.NewItem(GetItemSource_Loot(), (int)Position.X, (int)Position.Y, (int)HitboxSize.X, (int)HitboxSize.Y, itemType, itemStack, noBroadcast: true);
85594 Main.timeItemSlotCannotBeReusedFor[num] = 54000;
85595 for (int i = 0; i < 255; i++)
85596 {
85597 if (Main.player[i].active && (playerInteraction[i] || !interactionRequired))
85598 {
85599 NetMessage.SendData(90, i, -1, null, num);
85600 }
85601 }
85602 Main.item[num].active = false;
85603 }
85604 else if (Main.netMode == 0)
85605 {
85606 Item.NewItem(GetItemSource_Loot(), (int)Position.X, (int)Position.Y, (int)HitboxSize.X, (int)HitboxSize.Y, itemType, itemStack);
85607 }
85608 value = 0f;
85609 }
float value
How many copper coins the NPC will drop when killed (100 copper coins = 1 silver coin etc....
Definition NPC.cs:1156
bool[] playerInteraction
Tracks which T:Terraria.Players have damaged this NPC. Damaging boss minions or other parts of a boss...
Definition NPC.cs:529
IEntitySource GetItemSource_Loot()
Definition NPC.cs:107573

References Terraria.Main.item, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Main.player, Terraria.NetMessage.SendData(), and Terraria.Main.timeItemSlotCannotBeReusedFor.

+ Here is the call graph for this function: