mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
added exclude accounts parameter
This commit is contained in:
@@ -358,3 +358,19 @@ IndividualProgression.PvPGearRequirements = 1
|
||||
# 1 - Disabled
|
||||
#
|
||||
IndividualProgression.DisableRDF = 0
|
||||
#
|
||||
# IndividualProgression.ExcludeAccounts
|
||||
# Description: Enable or disable the exclusion of accounts from Individual Progression.
|
||||
# This is useful for accounts that are used for bots, testing, or other purposes where progression should not be enforced.
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
IndividualProgression.ExcludeAccounts = 0
|
||||
#
|
||||
# IndividualProgression.ExcludedAccountsRegex
|
||||
# Description: A regular expression to match account names that should be excluded from Individual Progression.
|
||||
# This is useful for accounts that are used for bots, testing, or other purposes where progression should not be enforced.
|
||||
# Only used if ExcludeAccounts is enabled.
|
||||
# Default: ""
|
||||
#
|
||||
IndividualProgression.ExcludedAccountsRegex = ""
|
||||
@@ -315,6 +315,8 @@ private:
|
||||
sIndividualProgression->LoadCustomProgressionEntries(sConfigMgr->GetOption<std::string>("IndividualProgression.CustomProgression", ""));
|
||||
sIndividualProgression->earlyDungeonSet2 = sConfigMgr->GetOption<bool>("IndividualProgression.AllowEarlyDungeonSet2", true);
|
||||
sIndividualProgression->pvpGearRequirements = sConfigMgr->GetOption<bool>("IndividualProgression.PvPGearRequirements", true);
|
||||
sIndividualProgression->excludeAccounts = sConfigMgr->GetOption<bool>("IndividualProgression.ExcludeAccounts", false);
|
||||
sIndividualProgression->excludedAccountsRegex = sConfigMgr->GetOption<std::string>("IndividualProgression.ExcludedAccountsRegex", "");
|
||||
}
|
||||
|
||||
static void LoadXpValues()
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "QuestDef.h"
|
||||
#include "GameObject.h"
|
||||
#include "IWorld.h"
|
||||
#include <regex>
|
||||
|
||||
typedef std::unordered_map<uint32, uint32> questXpMapType;
|
||||
|
||||
@@ -180,8 +181,9 @@ public:
|
||||
std::map<uint32, uint8> customProgressionMap;
|
||||
questXpMapType questXpMap;
|
||||
float vanillaPowerAdjustment, vanillaHealthAdjustment, tbcPowerAdjustment, tbcHealthAdjustment, vanillaHealingAdjustment, tbcHealingAdjustment, previousGearTuning;
|
||||
bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix, simpleConfigOverride, questMoneyAtLevelCap, repeatableVanillaQuestsXp, disableDefaultProgression, earlyDungeonSet2, requireNaxxStrath, pvpGearRequirements;
|
||||
bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix, simpleConfigOverride, questMoneyAtLevelCap, repeatableVanillaQuestsXp, disableDefaultProgression, earlyDungeonSet2, requireNaxxStrath, pvpGearRequirements, excludeAccounts;
|
||||
int progressionLimit, startingProgression, tbcRacesProgressionLevel, deathKnightProgressionLevel, deathKnightStartingProgression;
|
||||
std::string excludedAccountsRegex;
|
||||
|
||||
bool hasPassedProgression(Player* player, ProgressionState state) const;
|
||||
static bool isBeforeProgression(Player* player, ProgressionState state) ;
|
||||
|
||||
@@ -31,10 +31,11 @@ public:
|
||||
|
||||
void OnSetMaxLevel(Player* player, uint32& maxPlayerLevel) override
|
||||
{
|
||||
if (!sIndividualProgression->enabled)
|
||||
if (!sIndividualProgression->enabled || isExcludedFromProgression(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_NAXX40))
|
||||
{
|
||||
if (sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) > 60)
|
||||
@@ -159,9 +160,20 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool isExcludedFromProgression(Player* player)
|
||||
{
|
||||
if(!sIndividualProgression->excludeAccounts) {
|
||||
return false;
|
||||
}
|
||||
std::string accountName;
|
||||
bool gotAccountName = AccountMgr::GetName(player->GetSession()->GetAccountId(), accountName);
|
||||
std::regex excludedAccountsRegex (sIndividualProgression->excludedAccountsRegex);
|
||||
return (gotAccountName && std::regex_match(accountName, excludedAccountsRegex));
|
||||
}
|
||||
|
||||
bool OnBeforeTeleport(Player* player, uint32 mapid, float x, float y, float z, float /*orientation*/, uint32 /*options*/, Unit* /*target*/) override
|
||||
{
|
||||
if (!sIndividualProgression->enabled || player->IsGameMaster())
|
||||
if (!sIndividualProgression->enabled || player->IsGameMaster() || isExcludedFromProgression(player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user