tModLoader So I'm trying to make a modded item drop from a vanilla boss and the item hasn't dropped and I've killed 100+, Help?

CykaDot

Terrarian
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace MoreSharks.NPCs
{
public class DestroyerDrops : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (Main.rand.Next(2) == 5)
{
if (npc.type == NPCID.TheDestroyer)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TerraGem"));
}
}
}
}
}
 
Try changing "if (Main.rand.Next(2) == 5)" to "if (Main.rand.Next(5) == 0)" as in the original it is picking a number between 0 and 1 yet you are telling it to only work if it somehow picks a 5. In this new one it'll pick a number between 0 and 4 and if the number is 0 it'll drop the item.
 
Back
Top Bottom