From 10e0b33e82180bde33af1e1b03b7032df9143015 Mon Sep 17 00:00:00 2001 From: stacey <57187883+moisterrific@users.noreply.github.com> Date: Fri, 16 Jul 2021 14:19:37 -0400 Subject: [PATCH] Add Lunatic Cultist summon permission check Didn't bother adding the broadcast stuff bc there's 4 cultists and it'll prob spam the chat if multiple players kill them at around the same time --- TShockAPI/GetDataHandlers.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index ed701f2f..430d8256 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2829,6 +2829,17 @@ namespace TShockAPI else TShock.Utils.SendLogs(string.Format($"{args.Player.Name} summoned the Empress of Light!"), Color.PaleVioletRed, args.Player); } + + if (Main.npc[id].netID == NPCID.CultistDevote || Main.npc[id].netID == NPCID.CultistArcherBlue) + { + if (!args.Player.HasPermission(Permissions.summonboss)) + { + args.Player.SendErrorMessage("You do not have permission to summon the Lunatic Cultist!"); + args.Player.SendData(PacketTypes.NpcUpdate, "", id); + TShock.Log.ConsoleDebug($"GetDataHandlers / HandleNpcStrike rejected Cultist summon from {args.Player.Name}"); + return true; + } + } return false; }