fix(Scripts/ZulAman): Store chest count in DB (#21160)

This commit is contained in:
Andrew
2025-01-14 07:12:15 -03:00
committed by GitHub
parent 29f9187882
commit c16af59b5f
2 changed files with 9 additions and 5 deletions
@@ -112,7 +112,6 @@ public:
LoadBossBoundaries(boundaries); LoadBossBoundaries(boundaries);
LoadDoorData(doorData); LoadDoorData(doorData);
LoadSummonData(summonData); LoadSummonData(summonData);
_chestLooted = 0;
for (uint8 i = 0; i < RAND_VENDOR; ++i) for (uint8 i = 0; i < RAND_VENDOR; ++i)
RandVendor[i] = NOT_STARTED; RandVendor[i] = NOT_STARTED;
@@ -211,7 +210,10 @@ public:
_akilzonGauntlet = DONE; _akilzonGauntlet = DONE;
} }
else if (type == DATA_CHEST_LOOTED) else if (type == DATA_CHEST_LOOTED)
++_chestLooted; {
uint8 chestCount = GetPersistentData(DATA_CHEST_COUNT);
StorePersistentData(DATA_CHEST_COUNT, ++chestCount);
}
} }
void StartAkilzonGauntlet() void StartAkilzonGauntlet()
@@ -337,7 +339,7 @@ public:
else if (type == TYPE_AKILZON_GAUNTLET) else if (type == TYPE_AKILZON_GAUNTLET)
return _akilzonGauntlet; return _akilzonGauntlet;
else if (type == DATA_CHEST_LOOTED) else if (type == DATA_CHEST_LOOTED)
return _chestLooted; return GetPersistentData(DATA_CHEST_COUNT);
return 0; return 0;
} }
@@ -348,7 +350,6 @@ public:
} }
private: private:
uint16 _chestLooted;
uint32 RandVendor[RAND_VENDOR]; uint32 RandVendor[RAND_VENDOR];
GuidSet AkilzonTrash; GuidSet AkilzonTrash;
EncounterState _akilzonGauntlet = NOT_STARTED; EncounterState _akilzonGauntlet = NOT_STARTED;
@@ -90,14 +90,17 @@ enum GameobjectIds
enum MiscIds enum MiscIds
{ {
// Persistent data
DATA_TIMED_RUN = 0, DATA_TIMED_RUN = 0,
DATA_CHEST_COUNT = 1,
ACTION_START_TIMED_RUN = 0, ACTION_START_TIMED_RUN = 0,
ACTION_START_AKILZON_GAUNTLET = 1, ACTION_START_AKILZON_GAUNTLET = 1,
ACTION_RESET_AKILZON_GAUNTLET = 2, ACTION_RESET_AKILZON_GAUNTLET = 2,
GROUP_TIMED_RUN = 1 GROUP_TIMED_RUN = 1
}; };
uint32 constexpr PersistentDataCount = 1; uint32 constexpr PersistentDataCount = 2;
template <class AI, class T> template <class AI, class T>
inline AI* GetZulAmanAI(T* obj) inline AI* GetZulAmanAI(T* obj)