Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement option to stop requiring attunements prematurely #413

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = ""
7 changes: 7 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,11 @@ class ProgressionSystemLoadingDBUpdates : public DatabaseScript
DBUpdater<WorldDatabaseConnection>::Update(WorldDatabase, &worldDatabaseDirectories);
}
}

// Remove disabled attunements
std::string disabledAttunements = sConfigMgr->GetOption<std::string>("ProgressionSystem.DisabledAttunements", "");
for (auto& itr : Acore::Tokenize(disabledAttunements, ',', false))
WorldDatabase.Query("DELETE FROM dungeon_access_requirements WHERE dungeon_access_id = {}", Acore::StringTo<uint32>(itr).value());
}
};

Expand Down