mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Code Cleaning - Error Messages - Progression Level Fixes (#820)
- removing some duplicate code - adding some error messages - removing achievements if player decides to go down in progression level. - on login your progression level will no longer go down, if it's currently higher than the highest kill achievement you got
This commit is contained in:
@@ -9,21 +9,6 @@
|
||||
|
||||
class gobject_naxx40_tele : public GameObjectScript
|
||||
{
|
||||
private:
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
gobject_naxx40_tele() : GameObjectScript("gobject_naxx40_tele") { }
|
||||
|
||||
@@ -38,25 +23,14 @@ 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 ((isExcludedFromProgression(player) && (player->GetLevel() <= IP_LEVEL_TBC)) ||
|
||||
if ((sIndividualProgression->isExcludedFromProgression(player) && (player->GetLevel() <= IP_LEVEL_TBC)) ||
|
||||
((!sIndividualProgression->requireNaxxStrath || player->GetQuestStatus(NAXX40_ENTRANCE_FLAG) == QUEST_STATUS_REWARDED) && (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5))))
|
||||
{
|
||||
player->SetRaidDifficulty(RAID_DIFFICULTY_10MAN_HEROIC);
|
||||
|
||||
if (isAttuned(player) || isExcludedFromProgression(player))
|
||||
if (sIndividualProgression->isAttuned(player) || sIndividualProgression->isExcludedFromProgression(player))
|
||||
player->TeleportTo(533, 3005.51f, -3434.64f, 304.195f, 6.2831f);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user