From f405e7cbd63a3a5c6bcf90b6bd04e11f3bd0d388 Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Tue, 1 Oct 2013 18:03:34 -0400 Subject: [PATCH] Fix boss spawn items. --- TShockAPI/GetDataHandlers.cs | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 99d5cfd0..baea2286 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -3121,8 +3121,10 @@ namespace TShockAPI var invasion = -1; var plr = args.Data.ReadInt32(); var Type = args.Data.ReadInt32(); - spawnboss = (Type == 4 || Type == 13 || (Type == 50 || Type == 125) || (Type == 126 || Type == 134 || (Type == (int) sbyte.MaxValue || Type == 128))); - if (!spawnboss) + NPC npc = new NPC(); + npc.SetDefaults(Type); + spawnboss = npc.boss; + if (!spawnboss) { switch (Type) { @@ -3158,33 +3160,9 @@ namespace TShockAPI case -1: boss = "a Goblin Invasion"; break; - case 4: - boss = "the Eye of Cthulhu"; - break; - case 13: - boss = "the Eater of Worlds"; - break; - case 50: - boss = "the King Slime"; - break; - case 125: - boss = "Retinazer"; - break; - case 126: - boss = "Spazmatism"; - break; - case 134: - boss = "the Destroyer"; - break; - case sbyte.MaxValue: - boss = "Skeleton Prime"; - break; - case 128: - boss = "Skeleton Prime"; - break; default: - boss = "error"; - break; + boss = String.Format("the {0}", npc.name); + break; } TShock.Utils.SendLogs(string.Format("{0} summoned {1}", args.Player.Name, boss), Color.PaleVioletRed, args.Player);