fixing config stuff

This commit is contained in:
WebLuke
2025-09-09 14:04:52 -06:00
parent 59c6d9b979
commit 7c06da82dd
2 changed files with 18 additions and 27 deletions

View File

@@ -1,7 +1,3 @@
#
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
#
[worldserver]
########################################

View File

@@ -4,7 +4,7 @@
#include "ScriptMgr.h"
#include "Player.h"
#include "Config.h"
#include "Configuration/Config.h"
#include "Chat.h"
@@ -12,6 +12,7 @@
class GrowUp : public PlayerScript
{
public:
GrowUp() : PlayerScript("GrowUp", {
PLAYERHOOK_ON_LOGIN,
PLAYERHOOK_ON_FIRST_LOGIN,
@@ -22,7 +23,7 @@ public:
{
if (sConfigMgr->GetOption<bool>("GrownUp.Announce", true))
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00Grown Up |rmodule.");
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", true) && sConfigMgr->GetOption<bool>("GrownUp.LoginCheck", true))
if (sConfigMgr->GetOption<bool>("GrownUp.LoginCheck", true))
{
uint8 level = player->GetLevel();
float newScale = 1.0f;
@@ -41,17 +42,12 @@ public:
}
void OnPlayerFirstLogin(Player* player) override
{
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", true))
{
player->SetObjectScale(0.5f);
ChatHandler(player->GetSession()).SendSysMessage("Your adventure begins young one!");
}
}
void OnPlayerLevelChanged(Player* player, uint8 /*oldLevel*/) override
{
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", true))
{
uint8 newLevel = player->GetLevel();
float newScale = 1.0f; // default full size
@@ -69,7 +65,6 @@ public:
ChatHandler(player->GetSession())
.PSendSysMessage("Your adventure has grown!"); // Message when leveling up may try and add the % back later.
}
}
};
// Add all scripts in one