fix allowed bots

This prevents bots that aren't attuned or haven't progressed to the Naxx phase to be teleported inside

excluded random bots should still be able to get in
This commit is contained in:
Grimfeather
2025-06-06 23:41:10 +02:00
committed by GitHub
parent 15ad9356a4
commit 1dfb0372c3

View File

@@ -1,4 +1,5 @@
#include "IndividualProgression.h"
#include "naxxramas_40.h"
class IndividualPlayerProgression : public PlayerScript
{
@@ -171,6 +172,20 @@ public:
return (accountNameFound && std::regex_match(accountName, excludedAccountsRegex));
}
static bool isAttuned(Player* player)
{
if ((player->GetQuestStatus(NAXX40_ATTUNEMENT_1) == QUEST_STATUS_REWARDED) ||
(player->GetQuestStatus(NAXX40_ATTUNEMENT_2) == QUEST_STATUS_REWARDED) ||
(player->GetQuestStatus(NAXX40_ATTUNEMENT_3) == QUEST_STATUS_REWARDED))
{
return true;
}
else
{
return false;
}
}
bool OnPlayerBeforeTeleport(Player* player, uint32 mapid, float x, float y, float z, float /*orientation*/, uint32 /*options*/, Unit* /*target*/) override
{
if (!sIndividualProgression->enabled || player->IsGameMaster() || isExcludedFromProgression(player))
@@ -243,6 +258,10 @@ public:
{
return false;
}
if (instanceTemplate->Parent == MAP_NORTHREND && mapid == MAP_NAXXRAMAS && player->GetLevel() < 80 && (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_AQ) || !isAttuned(player)) )
{
return false;
}
}
return true;
}