Added /king to spawn king slime.

/eater, /eye, /king, /skeletron and /hardcore accept an optional amount arg
/skeletron changes time to night before spawning (still have to set time manually if using /spawnmob "Skeletron Head")
This commit is contained in:
ricky 2011-06-17 14:29:48 +10:00
parent e1aa43179b
commit 8dc1bcff0d
3 changed files with 99 additions and 55 deletions

View file

@ -195,12 +195,17 @@ namespace TShockAPI
NetMessage.syncPlayers();
}
public int SpawnNPC(int type, string name, int tileX, int tileY)
public void SpawnNPC(int type, string name, int amount, int startTileX, int startTileY, int tileXRange = 50, int tileYRange = 20)
{
int npcid = NPC.NewNPC(tileX * 16, tileY * 16, type, 0);
// This is for special slimes
Main.npc[npcid].SetDefaults(name);
return npcid;
for (int i = 0; i < amount; i++)
{
int spawnTileX;
int spawnTileY;
Tools.GetRandomClearTileWithInRange(startTileX, startTileY, tileXRange, tileYRange, out spawnTileX, out spawnTileY);
int npcid = NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type, 0);
// This is for special slimes
Main.npc[npcid].SetDefaults(name);
}
}
public void StrikeNPC(int npcid, int damage, float knockBack, int hitDirection)