Ivysaur
Official Terrarian
Hey, i'm back and have two questions~
One, how do I make a mob spawn during an eclipse/event~?
I've been trying a lot looking through the example mod and internet but haven't found anything which works
Code:public override float CanSpawn(NPCSpawnInfo spawnInfo) { Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; return spawnInfo.invasion.Maineclipse ? 0.5f : 0f; }
Two, what makes an npc spawn other npcs?
I have some code but it doesn't seem to work~
Code:if (npc.ai[0] % 600 == 3) { NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("GreaterPixie")); } npc.ai[1] += 0;
If you want to test for a solar eclipse you could try Main.eclipse
It's also used in the original source code.