How to make items drop from any enemy after a specific boss is killed?

ULTRAPLEB

Spazmatism
Hi, im trying to make an item that drops randomly by all enemies after king slime had been defeated as well as when EOC is dead. Could anyone tell me what i should do? heres the code im using for it btw. Thanks.

using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Resurrect.NPCLoot
{
public class PumpShotgunMK2 : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (npc.downedSlimeKing && npc.lifeMax > 5 && npc.value > 0f) ;
{
if (Main.rand.Next(140) == 0) //this is the item rarity, so 2 is 1 in 3 chance that the npc will drop the item.
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PumpShotgunMK2"), Main.rand.Next(1, 1));
}
}
}
}
}
 
Back
Top Bottom