orangepecan
Terrarian
Hey guys, is there documentation or an example anywhere for how to code all the vanilla buffs? I imagine this should be pretty simple. I'm trying to code a mod that combines different vanilla buffs together. Specifically, I want to combine vanilla buffs into a single buff.
Additionally, when adding a global drop, is it possible to add the drop to non-boss enemies only without having to check against every single enemy type?
Thanks for any help!
EDIT: Would this be correct for non-boss drops?
Additionally, when adding a global drop, is it possible to add the drop to non-boss enemies only without having to check against every single enemy type?
Thanks for any help!
EDIT: Would this be correct for non-boss drops?
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace <modname>
{
public class ModGlobalNPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (Main.rand.Next(50) == 0) //2% chance
{
if (!npc.boss)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("mod item id"));
}
}
}
}
}
Last edited: