Randomized spawn point for mobs (range 50x20 tiles in all directions)
This commit is contained in:
parent
b290802e6a
commit
8fa4687f33
3 changed files with 39 additions and 4 deletions
|
|
@ -195,9 +195,9 @@ namespace TShockAPI
|
|||
NetMessage.syncPlayers();
|
||||
}
|
||||
|
||||
public int SpawnNPC(int type, string name, int x, int y)
|
||||
public int SpawnNPC(int type, string name, int tileX, int tileY)
|
||||
{
|
||||
int npcid = NPC.NewNPC(x, y, type, 0);
|
||||
int npcid = NPC.NewNPC(tileX * 16, tileY * 16, type, 0);
|
||||
// This is for special slimes
|
||||
Main.npc[npcid].SetDefaults(name);
|
||||
return npcid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue