public static int SpawnNPC(int type, int tileX, int tileY)
{
var npc = type >= NPCID.Count ?
GetNPC(type).SpawnNPC(tileX, tileY) :
NPC.NewNPC(tileX * 16 + 8, tileY * 16, type);
foreach (var hook in HookSpawnNPC)
{
hook(npc, tileX, tileY);
}
return npc;
}