From 4feb9300209d4c82cc0ff33231ccd83496f353cd Mon Sep 17 00:00:00 2001 From: Deathmax Date: Wed, 1 Jun 2011 23:02:42 +0800 Subject: [PATCH] /butcher - kill all non-town NPCs - still glitchy, client doesn't properly update until the NPC is damaged --- TShockAPI/TShock.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index ef21063c..4b299602 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -411,6 +411,23 @@ namespace TShockAPI } handler.Handled = true; } + if (msg == "/butcher") + { + int killcount = 0; + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].townNPC || !Main.npc[i].active) + continue; + else + { + Main.npc[i].StrikeNPC(99999, 90f, 1); + NetMessage.SendData(28, -1, -1, "", ply, (float)99999, 90f, 1); + killcount++; + } + } + Tools.Broadcast("Killed " + killcount.ToString() + " NPCs."); + handler.Handled = true; + } } if (msg == "/help") {