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:
parent
e1aa43179b
commit
8dc1bcff0d
3 changed files with 99 additions and 55 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue