From 797b26b6c8ddef7b71462870d754333b8cae8aad Mon Sep 17 00:00:00 2001 From: Deathmax Date: Wed, 1 Jun 2011 15:59:36 +0800 Subject: [PATCH] Added a basic /spawnmob --- TShockAPI/TShock.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index cb4bb61e..06dfbb40 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -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") {