Added a basic /spawnmob

This commit is contained in:
Deathmax 2011-06-01 15:59:36 +08:00
parent f3ff33db62
commit 797b26b6c8

View file

@ -304,6 +304,20 @@ namespace TShockAPI
handler.Handled = true;
}
}
if (msg.Length > 9 && msg.Substring(0,9) == "/spawnmob")
{
string args = msg.Remove(0, 9).Trim();
int type = 0;
if (int.TryParse(args, out type))
{
if (type >= 1 && type <= 43)
{
var npcid = NPC.NewNPC(x, y, type, 0);
Tools.Broadcast("NPC " + type.ToString() + " spawned with ID " + npcid.ToString());
handler.Handled = true;
}
}
}
}
if (msg == "/help")
{