To Kazzymodus: I got 4 new errors after I edited the code with your recommendations. I only needed a recommendation for a different using directive / class: (NPC npc). I already knew that I should've put using Terraria;. Is there a using directive / class which is useable for NPC's in v.0.11.3?
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[7/ERROR] error CS0029: Cannot implicitly convert type 'int' to 'bool'
[7/ERROR] error CS1061: 'NPC' does not contain a definition for 'NewItem' and no accessible extension method 'NewItem' accepting a first argument of type 'NPC' could be found (are you missing a using directive or an assembly reference?)
[7/ERROR] error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
[7/ERROR] error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is the edited code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CastledsContent.NPCs
{
public class NpcLoot : GlobalNPC
{
private void NPCLoot(NPC npc)
{
if (npc.type = NPCID.MartianSaucerCore)
{
npc.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenSosCore"), 1);
}
}
}
}