Added support to spawn all types of slimes (have to use the full exact name)

Added SpawnNPC in TSServerPlayer
Warn user if multiple mob with name are found
This commit is contained in:
ricky 2011-06-17 11:21:37 +10:00
parent 7bccfbe441
commit 51aa337839
4 changed files with 98 additions and 67 deletions

View file

@ -195,6 +195,14 @@ namespace TShockAPI
NetMessage.syncPlayers();
}
public int SpawnNPC(int type, string name, int x, int y)
{
int npcid = NPC.NewNPC(x, y, type, 0);
// This is for special slimes
Main.npc[npcid].SetDefaults(name);
return npcid;
}
public void StrikeNPC(int npcid, int damage, float knockBack, int hitDirection)
{
Main.npc[npcid].StrikeNPC(damage, knockBack, hitDirection);