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:
parent
7bccfbe441
commit
51aa337839
4 changed files with 98 additions and 67 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue