regidia89
Terrarian
For example, there is the item called "A" which is selled by the arms dealer.
I want to make "A" is selled by the arms dealer after defeating Eye of Cthulhu.
So, I make the code like this, but it cannot compile.
How to solve this problem?
plus. the error message is like this; "error CS0103: The name 'GameEventCleared' does not exist in the current context."
I want to make "A" is selled by the arms dealer after defeating Eye of Cthulhu.
So, I make the code like this, but it cannot compile.
using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using GunNutMod.Items.Weapons; namespace GunNutMod.Content { class ExampleNPCShop : GlobalNPC { public override void SetupShop(int type, Chest shop, ref int nextSlot) { if (type == NPCID.ArmsDealer) { // Adding an item to a vanilla NPC is easy: // This item sells for the normal price. shop.item[nextSlot].SetDefaults(ModContent.ItemType<SingleShotgun>()); nextSlot++; // Don't forget this line, it is essential. if (GameEventCleared.DefeatedEyeOfCthulu) { shop.item[nextSlot].SetDefaults(ModContent.ItemType<LeverActionRifle>()); nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType<MP5>()); nextSlot++; } } } } } |
How to solve this problem?
plus. the error message is like this; "error CS0103: The name 'GameEventCleared' does not exist in the current context."