From 15c80c0b5ba61ab98beef7af54197146da2799fe Mon Sep 17 00:00:00 2001 From: AnchyDev Date: Fri, 3 Nov 2023 17:41:36 +1100 Subject: [PATCH] Prevent summon abuse for non-eligible players. --- src/scripts/ToSPlayerScript.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/scripts/ToSPlayerScript.cpp b/src/scripts/ToSPlayerScript.cpp index c7c7d89..12192d4 100644 --- a/src/scripts/ToSPlayerScript.cpp +++ b/src/scripts/ToSPlayerScript.cpp @@ -3,6 +3,8 @@ #include "TrialOfStrength.h" #include "ToSMapMgr.h" +#include "Chat.h" + bool ToSPlayerScript::CanRepopAtGraveyard(Player* player) { if (!player) @@ -37,6 +39,12 @@ bool ToSPlayerScript::OnBeforeTeleport(Player* player, uint32 mapId, float /*x*/ return true; } + if (!sToSMapMgr->CanPlayerEnter(player) && mapId == TOS_MAP_ID) + { + ChatHandler(player->GetSession()).SendSysMessage("|cffFF0000You do not meet the requirements to enter the Trial of Strength.|r"); + return false; + } + auto oldMapId = player->GetMapId(); if (oldMapId != TOS_MAP_ID) {