AxerTheAxe
Skeletron Prime
Hi, I have looked on the forums and have not been able to find any forum that solves my problem. Thanks!
public class ModGlobalNPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneOverworldHeight && Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneSnow)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ITEMNAMEHERE"), Main.rand.Next(1, 4));
}
}
}
This here will make any enemy in the surface snow biome drop the item.C#:public class ModGlobalNPC : GlobalNPC { public override void NPCLoot(NPC npc) { if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneOverworldHeight && Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneSnow) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ITEMNAMEHERE"), Main.rand.Next(1, 4)); } } }
The "Main.rand.Next(1, 4)" is how many will drop, if you only want 1 to drop at a time you do not need this.