feat(Core/Quests): Implemented quest_money_rewards (for quest with Qu… (#8610)

Fixes #8440
This commit is contained in:
UltraNix
2021-10-20 10:45:56 +02:00
committed by GitHub
parent 07484d0439
commit 1fb6830b15
12 changed files with 652 additions and 78 deletions

View File

@@ -690,6 +690,10 @@ struct DungeonEncounter
typedef std::list<DungeonEncounter const*> DungeonEncounterList;
typedef std::unordered_map<uint32, DungeonEncounterList> DungeonEncounterContainer;
static constexpr uint32 MAX_QUEST_MONEY_REWARDS = 10;
typedef std::array<uint32, MAX_QUEST_MONEY_REWARDS> QuestMoneyRewardArray;
typedef std::unordered_map<uint32, QuestMoneyRewardArray> QuestMoneyRewardStore;
class PlayerDumpReader;
class ObjectMgr
@@ -915,6 +919,7 @@ public:
}
void LoadQuests();
void LoadQuestMoneyRewards();
void LoadQuestStartersAndEnders()
{
LOG_INFO("server.loading", "Loading GO Start Quest Data...");
@@ -1361,6 +1366,8 @@ public:
[[nodiscard]] bool IsTransportMap(uint32 mapId) const { return _transportMaps.count(mapId) != 0; }
[[nodiscard]] uint32 GetQuestMoneyReward(uint8 level, uint32 questMoneyDifficulty) const;
private:
// first free id for selected id type
uint32 _auctionId; // pussywizard: accessed by a single thread
@@ -1523,6 +1530,8 @@ private:
};
std::set<uint32> _transportMaps; // Helper container storing map ids that are for transports only, loaded from gameobject_template
QuestMoneyRewardStore _questMoneyRewards;
};
#define sObjectMgr ObjectMgr::instance()