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
This commit is contained in:
stacey 2021-07-16 14:19:37 -04:00 committed by GitHub
parent 26460a13c4
commit 10e0b33e82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}