diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 6dd36b6..f40b756 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -75,7 +75,7 @@ public: void OnLogin(Player* player) { // Announce Module - if (sConfigMgr->GetBoolDefault("Congrats.Announce", true)) + if (sConfigMgr->GetOption("Congrats.Announce", true)) { ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00CongratsOnLevel |rmodule."); } @@ -92,7 +92,7 @@ public: void OnLevelChanged(Player* player, uint8 oldLevel) override { // If enabled... - if (sConfigMgr->GetBoolDefault("Congrats.Enable", true)) { + if (sConfigMgr->GetOption("Congrats.Enable", true)) { std::string level; uint32 money, item1, item2, spell; @@ -100,10 +100,10 @@ public: if (oldLevel < 10 && player->getLevel() == 10) { // Level 10 - const uint32 L101 = sConfigMgr->GetIntDefault("Congrats.L101", 0); - const uint32 L102 = sConfigMgr->GetIntDefault("Congrats.L102", 0); - const uint32 L10M = sConfigMgr->GetIntDefault("Congrats.L10M", 0); - const uint32 L10S = sConfigMgr->GetIntDefault("Congrats.L10S", 0); + const uint32 L101 = sConfigMgr->GetOption("Congrats.L101", 0); + const uint32 L102 = sConfigMgr->GetOption("Congrats.L102", 0); + const uint32 L10M = sConfigMgr->GetOption("Congrats.L10M", 0); + const uint32 L10S = sConfigMgr->GetOption("Congrats.L10S", 0); level = "10"; item1 = L101; @@ -114,10 +114,10 @@ public: else if (oldLevel < 20 && player->getLevel() == 20) { // Level 20 - const uint32 L201 = sConfigMgr->GetIntDefault("Congrats.L201", 0); - const uint32 L202 = sConfigMgr->GetIntDefault("Congrats.L202", 0); - const uint32 L20M = sConfigMgr->GetIntDefault("Congrats.L20M", 0); - const uint32 L20S = sConfigMgr->GetIntDefault("Congrats.L20S", 0); + const uint32 L201 = sConfigMgr->GetOption("Congrats.L201", 0); + const uint32 L202 = sConfigMgr->GetOption("Congrats.L202", 0); + const uint32 L20M = sConfigMgr->GetOption("Congrats.L20M", 0); + const uint32 L20S = sConfigMgr->GetOption("Congrats.L20S", 0); level = "20"; item1 = L201; @@ -128,10 +128,10 @@ public: else if (oldLevel < 30 && player->getLevel() == 30) { // Level 30 - const uint32 L301 = sConfigMgr->GetIntDefault("Congrats.L301", 0); - const uint32 L302 = sConfigMgr->GetIntDefault("Congrats.L302", 0); - const uint32 L30M = sConfigMgr->GetIntDefault("Congrats.L30M", 0); - const uint32 L30S = sConfigMgr->GetIntDefault("Congrats.L30S", 0); + const uint32 L301 = sConfigMgr->GetOption("Congrats.L301", 0); + const uint32 L302 = sConfigMgr->GetOption("Congrats.L302", 0); + const uint32 L30M = sConfigMgr->GetOption("Congrats.L30M", 0); + const uint32 L30S = sConfigMgr->GetOption("Congrats.L30S", 0); level = "30"; item1 = L301; @@ -142,10 +142,10 @@ public: else if (oldLevel < 40 && player->getLevel() == 40) { // Level 40 - const uint32 L401 = sConfigMgr->GetIntDefault("Congrats.L401", 0); - const uint32 L402 = sConfigMgr->GetIntDefault("Congrats.L402", 0); - const uint32 L40M = sConfigMgr->GetIntDefault("Congrats.L40M", 0); - const uint32 L40S = sConfigMgr->GetIntDefault("Congrats.L40S", 0); + const uint32 L401 = sConfigMgr->GetOption("Congrats.L401", 0); + const uint32 L402 = sConfigMgr->GetOption("Congrats.L402", 0); + const uint32 L40M = sConfigMgr->GetOption("Congrats.L40M", 0); + const uint32 L40S = sConfigMgr->GetOption("Congrats.L40S", 0); level = "40"; item1 = L401; @@ -156,10 +156,10 @@ public: else if (oldLevel < 50 && player->getLevel() == 50) { // Level 50 - const uint32 L501 = sConfigMgr->GetIntDefault("Congrats.L501", 0); - const uint32 L502 = sConfigMgr->GetIntDefault("Congrats.L502", 0); - const uint32 L50M = sConfigMgr->GetIntDefault("Congrats.L50M", 0); - const uint32 L50S = sConfigMgr->GetIntDefault("Congrats.L50S", 0); + const uint32 L501 = sConfigMgr->GetOption("Congrats.L501", 0); + const uint32 L502 = sConfigMgr->GetOption("Congrats.L502", 0); + const uint32 L50M = sConfigMgr->GetOption("Congrats.L50M", 0); + const uint32 L50S = sConfigMgr->GetOption("Congrats.L50S", 0); level = "50"; item1 = L501; @@ -170,10 +170,10 @@ public: else if (oldLevel < 60 && player->getLevel() == 60) { // Level 60 - const uint32 L601 = sConfigMgr->GetIntDefault("Congrats.L601", 0); - const uint32 L602 = sConfigMgr->GetIntDefault("Congrats.L602", 0); - const uint32 L60M = sConfigMgr->GetIntDefault("Congrats.L60M", 0); - const uint32 L60S = sConfigMgr->GetIntDefault("Congrats.L60S", 0); + const uint32 L601 = sConfigMgr->GetOption("Congrats.L601", 0); + const uint32 L602 = sConfigMgr->GetOption("Congrats.L602", 0); + const uint32 L60M = sConfigMgr->GetOption("Congrats.L60M", 0); + const uint32 L60S = sConfigMgr->GetOption("Congrats.L60S", 0); level = "60"; item1 = L601; @@ -184,10 +184,10 @@ public: else if (oldLevel < 70 && player->getLevel() == 70) { // Level 70 - const uint32 L701 = sConfigMgr->GetIntDefault("Congrats.L701", 0); - const uint32 L702 = sConfigMgr->GetIntDefault("Congrats.L702", 0); - const uint32 L70M = sConfigMgr->GetIntDefault("Congrats.L70M", 0); - const uint32 L70S = sConfigMgr->GetIntDefault("Congrats.L70S", 0); + const uint32 L701 = sConfigMgr->GetOption("Congrats.L701", 0); + const uint32 L702 = sConfigMgr->GetOption("Congrats.L702", 0); + const uint32 L70M = sConfigMgr->GetOption("Congrats.L70M", 0); + const uint32 L70S = sConfigMgr->GetOption("Congrats.L70S", 0); level = "70"; item1 = L701; @@ -198,10 +198,10 @@ public: else if (oldLevel < 80 && player->getLevel() == 80) { // Level 80 - const uint32 L801 = sConfigMgr->GetIntDefault("Congrats.L801", 0); - const uint32 L802 = sConfigMgr->GetIntDefault("Congrats.L802", 0); - const uint32 L80M = sConfigMgr->GetIntDefault("Congrats.L80M", 0); - const uint32 L80S = sConfigMgr->GetIntDefault("Congrats.L80S", 0); + const uint32 L801 = sConfigMgr->GetOption("Congrats.L801", 0); + const uint32 L802 = sConfigMgr->GetOption("Congrats.L802", 0); + const uint32 L80M = sConfigMgr->GetOption("Congrats.L80M", 0); + const uint32 L80S = sConfigMgr->GetOption("Congrats.L80S", 0); level = "80"; item1 = L801; @@ -211,7 +211,7 @@ public: } // If enabled... - if (sConfigMgr->GetBoolDefault("CongratsPerLevel.Enable", true)) + if (sConfigMgr->GetOption("CongratsPerLevel.Enable", true)) { // Issue a server notification for the player on level up. std::ostringstream ss;