From 38a8bbc1d3639e58f383e339f35b012480305384 Mon Sep 17 00:00:00 2001 From: MarioE Date: Wed, 2 Oct 2013 20:15:08 -0400 Subject: [PATCH 1/2] Fix crimson purification --- TShockAPI/GetDataHandlers.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index f66fe30e..98293c96 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1774,6 +1774,30 @@ namespace TShockAPI tile.type = 1; changed = true; } + // Purify crimson grass + else if (tile.type == 199 && newtile.Type == 2) + { + tile.type = 2; + changed = true; + } + // Purify crimstone + else if (tile.type == 203 && newtile.Type == 1) + { + tile.type = 1; + changed = true; + } + // Purify crimson grass vine -- might not be needed + else if (tile.type == 205 && newtile.Type == 52) + { + tile.type = 53; + changed = true; + } + // Purify crimsand + else if (tile.type == 234 && newtile.Type == 53) + { + tile.type = 53; + changed = true; + } } } From 92da91522b90d537b0c66f5fc78088dcd7ad8f93 Mon Sep 17 00:00:00 2001 From: MarioE Date: Wed, 2 Oct 2013 21:13:55 -0400 Subject: [PATCH 2/2] Fix pirate invasion --- TShockAPI/GetDataHandlers.cs | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 98293c96..0f70932b 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -3169,43 +3169,33 @@ namespace TShockAPI private static bool HandleSpawnBoss(GetDataHandlerArgs args) { - var spawnboss = false; - var invasion = -1; var plr = args.Data.ReadInt32(); var Type = args.Data.ReadInt32(); + int invasion = -1 * Type; NPC npc = new NPC(); npc.SetDefaults(Type); - spawnboss = npc.boss; - if (!spawnboss) - { - switch (Type) - { - case -1: - invasion = 1; - break; - case -2: - invasion = 2; - break; - } - } - if (spawnboss && !args.Player.Group.HasPermission(Permissions.summonboss)) + + if (invasion <= 0 && !args.Player.Group.HasPermission(Permissions.summonboss)) { args.Player.SendMessage("You don't have permission to summon a boss.", Color.Red); return true; } - if (invasion != -1 && !args.Player.Group.HasPermission(Permissions.startinvasion)) + if (invasion > 0 && !args.Player.Group.HasPermission(Permissions.startinvasion)) { args.Player.SendMessage("You don't have permission to start an invasion.", Color.Red); return true; } - if (!spawnboss && invasion == -1) + if (!npc.boss || invasion > 3 || plr != args.Player.Index) + { return true; - if (plr != args.Player.Index) - return true; - + } + string boss; switch (Type) { + case -3: + boss = "the pirates"; + break; case -2: boss = "the Snow Legion"; break; @@ -3217,7 +3207,7 @@ namespace TShockAPI break; } - TShock.Utils.SendLogs(string.Format("{0} summoned {1}", args.Player.Name, boss), Color.PaleVioletRed, args.Player); + TShock.Utils.SendLogs(string.Format("{0} summoned {1}.", args.Player.Name, boss), Color.PaleVioletRed, args.Player); return false; }