Merge pull request #485 from Grimfeather/fix-Naxx-40-zone-in-bug

fixes for Naxx 40 zone in
This commit is contained in:
Grimfeather
2025-06-07 02:24:46 +02:00
committed by GitHub
3 changed files with 43 additions and 10 deletions

View File

@@ -116,10 +116,10 @@ IndividualProgression.HunterPetLevelFix = 1
# before being able to use the teleportation crystal in EPL. This is consistent behavior with other Vanilla raids (MC, BL). # before being able to use the teleportation crystal in EPL. This is consistent behavior with other Vanilla raids (MC, BL).
# If disabled, players can enter Naxx 40 through the crystal as soon as they are attuned and they have reached the correct # If disabled, players can enter Naxx 40 through the crystal as soon as they are attuned and they have reached the correct
# progression level - no Stratholme run will be required. # progression level - no Stratholme run will be required.
# Default: 1 - Enabled # Default: 0 - Disabled
# 0 - Disabled # 1 - Enabled
# #
IndividualProgression.RequireNaxxStrathEntrance = 1 IndividualProgression.RequireNaxxStrathEntrance = 0
# IndividualProgression.MoltenCore.ManualRuneHandling # IndividualProgression.MoltenCore.ManualRuneHandling
# Description: Defines whether Molten Core runes are handled manually (dousing through Aqual Quintessence) # Description: Defines whether Molten Core runes are handled manually (dousing through Aqual Quintessence)

View File

@@ -1,4 +1,5 @@
#include "IndividualProgression.h" #include "IndividualProgression.h"
#include "naxxramas_40.h"
class IndividualPlayerProgression : public PlayerScript class IndividualPlayerProgression : public PlayerScript
{ {
@@ -171,6 +172,20 @@ public:
return (accountNameFound && std::regex_match(accountName, excludedAccountsRegex)); 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 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)) if (!sIndividualProgression->enabled || player->IsGameMaster() || isExcludedFromProgression(player))
@@ -243,6 +258,10 @@ public:
{ {
return false; return false;
} }
if (instanceTemplate->Parent == MAP_NORTHREND && mapid == MAP_NAXXRAMAS && player->GetLevel() < 71 && !isAttuned(player))
{
return false;
}
} }
return true; return true;
} }

View File

@@ -12,13 +12,16 @@ class gobject_naxx40_tele : public GameObjectScript
private: private:
static bool isAttuned(Player* player) static bool isAttuned(Player* player)
{ {
if (player->GetQuestStatus(NAXX40_ATTUNEMENT_1) == QUEST_STATUS_REWARDED) 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; return true;
if (player->GetQuestStatus(NAXX40_ATTUNEMENT_2) == QUEST_STATUS_REWARDED) }
return true; else
if (player->GetQuestStatus(NAXX40_ATTUNEMENT_3) == QUEST_STATUS_REWARDED) {
return true; return false;
return false; }
} }
public: public:
@@ -35,9 +38,20 @@ public:
return new gobject_naxx40_teleAI(object); return new gobject_naxx40_teleAI(object);
} }
bool isExcludedFromProgression(Player* player)
{
if(!sIndividualProgression->excludeAccounts) {
return false;
}
std::string accountName;
bool accountNameFound = AccountMgr::GetName(player->GetSession()->GetAccountId(), accountName);
std::regex excludedAccountsRegex (sIndividualProgression->excludedAccountsRegex);
return (accountNameFound && std::regex_match(accountName, excludedAccountsRegex));
}
bool OnGossipHello(Player* player, GameObject* /*go*/) override bool OnGossipHello(Player* player, GameObject* /*go*/) override
{ {
if ((!sIndividualProgression->requireNaxxStrath || player->GetQuestStatus(NAXX40_ENTRANCE_FLAG) == QUEST_STATUS_REWARDED) && isAttuned(player)) if (((!sIndividualProgression->requireNaxxStrath || player->GetQuestStatus(NAXX40_ENTRANCE_FLAG) == QUEST_STATUS_REWARDED) && isAttuned(player)) || (isExcludedFromProgression(player) && (player->GetLevel() < 71)))
{ {
player->SetRaidDifficulty(RAID_DIFFICULTY_10MAN_HEROIC); player->SetRaidDifficulty(RAID_DIFFICULTY_10MAN_HEROIC);
player->TeleportTo(533, 3005.51f, -3434.64f, 304.195f, 6.2831f); player->TeleportTo(533, 3005.51f, -3434.64f, 304.195f, 6.2831f);