Randomized spawn point for mobs (range 50x20 tiles in all directions)

This commit is contained in:
ricky 2011-06-17 13:11:28 +10:00
parent b290802e6a
commit 8fa4687f33
3 changed files with 39 additions and 4 deletions

View file

@ -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;