From c16af59b5f9f3dbaedb01bc633caca2c4b654f1b Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:12:15 -0300 Subject: [PATCH] fix(Scripts/ZulAman): Store chest count in DB (#21160) --- .../scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp | 9 +++++---- src/server/scripts/EasternKingdoms/ZulAman/zulaman.h | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 555c38b7c..d443425eb 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -112,7 +112,6 @@ public: LoadBossBoundaries(boundaries); LoadDoorData(doorData); LoadSummonData(summonData); - _chestLooted = 0; for (uint8 i = 0; i < RAND_VENDOR; ++i) RandVendor[i] = NOT_STARTED; @@ -211,7 +210,10 @@ public: _akilzonGauntlet = DONE; } else if (type == DATA_CHEST_LOOTED) - ++_chestLooted; + { + uint8 chestCount = GetPersistentData(DATA_CHEST_COUNT); + StorePersistentData(DATA_CHEST_COUNT, ++chestCount); + } } void StartAkilzonGauntlet() @@ -337,7 +339,7 @@ public: else if (type == TYPE_AKILZON_GAUNTLET) return _akilzonGauntlet; else if (type == DATA_CHEST_LOOTED) - return _chestLooted; + return GetPersistentData(DATA_CHEST_COUNT); return 0; } @@ -348,7 +350,6 @@ public: } private: - uint16 _chestLooted; uint32 RandVendor[RAND_VENDOR]; GuidSet AkilzonTrash; EncounterState _akilzonGauntlet = NOT_STARTED; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index 1004be12f..444da72d0 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -90,14 +90,17 @@ enum GameobjectIds enum MiscIds { + // Persistent data DATA_TIMED_RUN = 0, + DATA_CHEST_COUNT = 1, + ACTION_START_TIMED_RUN = 0, ACTION_START_AKILZON_GAUNTLET = 1, ACTION_RESET_AKILZON_GAUNTLET = 2, GROUP_TIMED_RUN = 1 }; -uint32 constexpr PersistentDataCount = 1; +uint32 constexpr PersistentDataCount = 2; template inline AI* GetZulAmanAI(T* obj)