mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Added logic to Convert UScore to Coins for Level 45 Characters (#348)
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user