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

◆ ModifyItemDropFromNPC()

static void Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC ( NPC npc,
int itemIndex )
inlinestatic

Definition at line 76 of file CommonCode.cs.

77 {
78 Item item = Main.item[itemIndex];
79 switch (item.type)
80 {
81 case 23:
82 if (npc.type == 1 && npc.netID != -1 && npc.netID != -2 && npc.netID != -5 && npc.netID != -6)
83 {
84 item.color = npc.color;
85 NetMessage.SendData(88, -1, -1, null, itemIndex, 1f);
86 }
87 if (Main.remixWorld && npc.type == 59)
88 {
89 item.color = new Color(255, 127, 0);
90 NetMessage.SendData(88, -1, -1, null, itemIndex, 1f);
91 }
92 break;
93 case 319:
94 switch (npc.netID)
95 {
96 case 542:
97 item.color = new Color(189, 148, 96, 255);
98 NetMessage.SendData(88, -1, -1, null, itemIndex, 1f);
99 break;
100 case 543:
101 item.color = new Color(112, 85, 89, 255);
102 NetMessage.SendData(88, -1, -1, null, itemIndex, 1f);
103 break;
104 case 544:
105 item.color = new Color(145, 27, 40, 255);
106 NetMessage.SendData(88, -1, -1, null, itemIndex, 1f);
107 break;
108 case 545:
109 item.color = new Color(158, 113, 164, 255);
110 NetMessage.SendData(88, -1, -1, null, itemIndex, 1f);
111 break;
112 }
113 break;
114 }
115 }

References Terraria.NPC.color, Terraria.Main.item, Terraria.NPC.netID, Terraria.Main.remixWorld, Terraria.NetMessage.SendData(), and Terraria.NPC.type.

Referenced by Terraria.GameContent.ItemDropRules.CommonCode.DropItemForEachInteractingPlayerOnThePlayer(), and Terraria.GameContent.ItemDropRules.CommonCode.DropItemFromNPC().