2021-12-05 17:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Custom Classes
|
|
|
|
#include "CDTable.h"
|
|
|
|
|
|
|
|
struct CDLootMatrix {
|
|
|
|
unsigned int LootTableIndex; //!< The Loot Table Index
|
|
|
|
unsigned int RarityTableIndex; //!< The Rarity Table Index
|
|
|
|
float percent; //!< The percent that this matrix is used?
|
|
|
|
unsigned int minToDrop; //!< The minimum amount of loot from this matrix to drop
|
|
|
|
unsigned int maxToDrop; //!< The maximum amount of loot from this matrix to drop
|
|
|
|
unsigned int flagID; //!< ???
|
|
|
|
UNUSED(std::string gate_version); //!< The Gate Version
|
|
|
|
};
|
|
|
|
|
2023-10-09 20:33:22 +00:00
|
|
|
typedef uint32_t LootMatrixIndex;
|
|
|
|
typedef std::vector<CDLootMatrix> LootMatrixEntries;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-10-09 20:33:22 +00:00
|
|
|
class CDLootMatrixTable : public CDTable<CDLootMatrixTable> {
|
2021-12-05 17:54:36 +00:00
|
|
|
public:
|
2023-08-11 04:27:40 +00:00
|
|
|
void LoadValuesFromDatabase();
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-10-09 20:33:22 +00:00
|
|
|
// Gets a matrix by ID or inserts a blank one if none existed.
|
|
|
|
const LootMatrixEntries& GetMatrix(uint32_t matrixId);
|
|
|
|
private:
|
|
|
|
CDLootMatrix ReadRow(CppSQLite3Query& tableData) const;
|
|
|
|
std::unordered_map<LootMatrixIndex, LootMatrixEntries> entries;
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|