mirror of
https://github.com/webluke/mod-grownup.git
synced 2026-01-13 01:08:39 +00:00
fixing config stuff
This commit is contained in:
@@ -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]
|
||||
|
||||
########################################
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user