From a1306a74807b4f1a5d6b13ae78306f17118f5664 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Thu, 10 Jun 2021 18:58:59 +0200 Subject: [PATCH] disable experience in challenge mode --- README.md | 6 ++++++ .../src/scripts/ChallengeModeScript.cpp | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 652ddea..dc73f00 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,16 @@ To uninstall: `./acore.sh module uninstall mod-azerothshard` +## Configure + +Create a copy of the `azth_mod.conf.dist` and rename it as `azth_mod.conf` under your etc folder +Then you can change configurations as you whish + ## Features List of features that will be published open-source: +* Challenge Mode * Mythic+ * PlayerStats * Timewalking (libraries only) diff --git a/modules/mod-challenge-mode/src/scripts/ChallengeModeScript.cpp b/modules/mod-challenge-mode/src/scripts/ChallengeModeScript.cpp index a900a88..baf5572 100644 --- a/modules/mod-challenge-mode/src/scripts/ChallengeModeScript.cpp +++ b/modules/mod-challenge-mode/src/scripts/ChallengeModeScript.cpp @@ -44,12 +44,26 @@ class ChallengeModeMisc : public MiscScript class ChallengeModePlayer : public PlayerScript { public: - ChallengeModePlayer() : PlayerScript("ChallengeModePlayer") { } + ChallengeModePlayer() : PlayerScript("ChallengeModePlayer") { + + } bool OnBeforeAchiComplete(Player* player, AchievementEntry const* /* achievement */) override { return sChallengeMode->isEligibleForReward(player); } + + bool OnBeforeCriteriaProgress(Player* player, AchievementCriteriaEntry const* /*criteria*/) override + { + return sChallengeMode->isEligibleForReward(player); + } + + void OnGivePlayerXP(Player* player, uint32& amount, Unit* /* victim */) override + { + if (!sChallengeMode->isEligibleForReward(player)) { + amount = 0 + } + } }; class ChallengeModeGlobal : public GlobalScript