Added logic to Convert UScore to Coins for Level 45 Characters (#348)

This commit is contained in:
David Markowitz
2022-02-02 22:50:02 -08:00
committed by GitHub
parent dac8ec621c
commit 13980c4133
8 changed files with 54 additions and 16 deletions

View File

@@ -118,6 +118,24 @@ LWOZONEID dZoneManager::GetZoneID() const
return m_ZoneID;
}
uint32_t dZoneManager::GetMaxLevel() {
if (m_MaxLevel == 0) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT LevelCap FROM WorldConfig WHERE WorldConfigID = 1 LIMIT 1;");
m_MaxLevel = tableData.getIntField(0, -1);
tableData.finalize();
}
return m_MaxLevel;
}
int32_t dZoneManager::GetLevelCapCurrencyConversion() {
if (m_CurrencyConversionRate == 0) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT LevelCapCurrencyConversion FROM WorldConfig WHERE WorldConfigID = 1 LIMIT 1;");
m_CurrencyConversionRate = tableData.getIntField(0, -1);
tableData.finalize();
}
return m_CurrencyConversionRate;
}
void dZoneManager::Update(float deltaTime) {
for (auto spawner : m_Spawners) {
spawner.second->Update(deltaTime);

View File

@@ -33,6 +33,8 @@ public:
void NotifyZone(const dZoneNotifier& notifier, const LWOOBJID& objectID); //Notifies the zone of a certain event or command.
void AddSpawner(LWOOBJID id, Spawner* spawner);
LWOZONEID GetZoneID() const;
uint32_t GetMaxLevel();
int32_t GetLevelCapCurrencyConversion();
LWOOBJID MakeSpawner(SpawnerInfo info);
Spawner* GetSpawner(LWOOBJID id);
void RemoveSpawner(LWOOBJID id);
@@ -42,6 +44,16 @@ public:
Entity* GetZoneControlObject() { return m_ZoneControlObject; }
private:
/**
* The maximum level of the world.
*/
uint32_t m_MaxLevel = 0;
/**
* The ratio of LEGO Score to currency when the character has hit the max level.
*/
int32_t m_CurrencyConversionRate = 0;
static dZoneManager* m_Address; //Singleton
Zone* m_pZone;
LWOZONEID m_ZoneID;