mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Update custom_gameobjects_40.cpp
trying to find a solution
This commit is contained in:
@@ -12,13 +12,16 @@ class gobject_naxx40_tele : public GameObjectScript
|
||||
private:
|
||||
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;
|
||||
if (player->GetQuestStatus(NAXX40_ATTUNEMENT_2) == QUEST_STATUS_REWARDED)
|
||||
return true;
|
||||
if (player->GetQuestStatus(NAXX40_ATTUNEMENT_3) == QUEST_STATUS_REWARDED)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -35,9 +38,20 @@ public:
|
||||
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
|
||||
{
|
||||
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() == 60)))
|
||||
{
|
||||
player->SetRaidDifficulty(RAID_DIFFICULTY_10MAN_HEROIC);
|
||||
player->TeleportTo(533, 3005.51f, -3434.64f, 304.195f, 6.2831f);
|
||||
|
||||
Reference in New Issue
Block a user