Skip to content

Commit

Permalink
feat: Implement option to stop requiring attunements prematurely
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah committed Aug 26, 2024
1 parent 0548bdd commit b501976
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions conf/progression_system.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,11 @@ ProgressionSystem.70.SerpentshrineCavern.RequireAllBosses = 1
#

ProgressionSystem.70.TheEye.RequireAllBosses = 1

# ProgressionSystem.DisabledAttunements
# Description: Clears the selected attunements (dungeon_access_requirement) from database, even if SQL reapply mode is on.
# Use this to end an attunement requirement prematurely, or debug.
# Use `dungeon_access_id` separated by a comma, e.g "32, 64" to disable the attunements for Hyjal & Black Temple, respectively.
#

ProgressionSystem.DisabledAttunements = ""
11 changes: 11 additions & 0 deletions src/ProgressionSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "ProgressionSystem.h"
#include "DBUpdater.h"
#include "Tokenize.h"
#include "StringConvert.h"

inline std::vector<std::string> GetDatabaseDirectories(std::string const& folderName)
{
Expand Down Expand Up @@ -74,6 +76,15 @@ class ProgressionSystemLoadingDBUpdates : public DatabaseScript
DBUpdater<WorldDatabaseConnection>::Update(WorldDatabase, &worldDatabaseDirectories);
}
}

// Remove disabled attunements
std::string disabledAttunements = sConfigMgr->GetOption<std::string>("ProgressionSystem.DisabledAttunements", "");
std::vector<uint32> attunementIds;
for (auto& itr : Acore::Tokenize(disabledAttunements, ',', false))
attunementIds.push_back(Acore::StringTo<uint32>(itr).value());

for (auto const& id : attunementIds)
WorldDatabase.Query("DELETE FROM dungeon_access_requirements WHERE dungeon_access_id = {}", id);
}
};

Expand Down

0 comments on commit b501976

Please sign in to comment.