Please use the code tags so that we keep the formatting. Code displayed as normal text, without preserving the whitespace, is hard to read.
Your problem is that your SetupShop() function is not properly closed, so it "eats" the next few functions (TownNPCAttackStrength, TownNPCAttackCooldown, etc.). You open one brace for the function's content, then you open another brace for the if (spirit != null) conditions, and then you have a loooong list of vanilla items you add (well over 40, so you'll need a shop extender if you want all 84 items I've counted to be actually available, in vanilla merchants have only 40 shop slots, you may want to address that), and then you close one brace, but not two.
Also this looks very wrong to me:
I'm not a C# coder, but I'm familiar enough with a lot of other C-family language (C, C++, Java, JavaScript, Perl, and a few more obscure scripting languages) and from that experience I'm pretty sure your thing cannot work.
If you don't use curly braces after an if () condition, only the next instruction is run. That means that if you don't have, for example, Thorium loaded, then thorium is null, so the next instruction (which is Mod calamity = ModLoader.GetMod("CalamityMod")) isn't run, so when you check calamity it'll be null too even if Calamity is loaded. Worst case, the calamity variable will not even exist and you'll get a crash.
You should instead do something like
Code:
Mod thorium = ModLoader.GetMod("ThoriumMod");
Mod calamity = ModLoader.GetMod("CalamityMod");
Mod tremor = ModLoader.GetMod("Tremor");
Mod spirit = ModLoader.GetMod("SpiritMod");
No condition checks there. Keep your condition checks only for when you're going to actually reference them. The way you've got that shop set up, the merchant will sell vanilla items if all four mods are loaded, and nothing if any mod is missing. I haven't actually seen any of your mod references being used.
Another thing, not a bug but still worth addressing is this:
Code:
public override string TownNPCName()
{
switch (WorldGen.genRand.Next(4))
{
case 0:
return "Kimi";
case 1:
return "Kimi";
case 2:
return "Kimi";
default:
return "Kimi";
}
}
If you're just gonna use Kimi as your NPC name, why bother making it random?
Code:
public override string TownNPCName()
{
return "Kimi";
}
That's all you need.