mirror of
https://github.com/webluke/mod-grownup.git
synced 2026-01-13 01:08:39 +00:00
use new OnPlayer method override, syntax errors
This commit is contained in:
@@ -12,15 +12,17 @@
|
|||||||
class GrowUp : public PlayerScript
|
class GrowUp : public PlayerScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GrowUp() : PlayerScript("GrowUp") {
|
GrowUp() : PlayerScript("GrowUp", {
|
||||||
PLAYERHOOK_ON_LOGIN,
|
PLAYERHOOK_ON_LOGIN,
|
||||||
PLAYERHOOK_ON_FIRST_LOGIN,
|
PLAYERHOOK_ON_FIRST_LOGIN,
|
||||||
PLAYERHOOK_ON_LEVEL_CHANGED
|
PLAYERHOOK_ON_LEVEL_CHANGED
|
||||||
}
|
}) { }
|
||||||
|
|
||||||
void OnPlayerLogin(Player* player) override
|
void OnPlayerLogin(Player* player) override
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", false) && sConfigMgr->GetOption<bool>("GrownUp.LoginCheck", false))
|
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))
|
||||||
{
|
{
|
||||||
uint8 level = player->getLevel();
|
uint8 level = player->getLevel();
|
||||||
float newScale = 1.0f;
|
float newScale = 1.0f;
|
||||||
@@ -38,18 +40,18 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnFirstLogin(Player* player) override
|
void OnPlayerFirstLogin(Player* player) override
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", false))
|
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", true))
|
||||||
{
|
{
|
||||||
player->SetObjectScale(0.5f);
|
player->SetObjectScale(0.5f);
|
||||||
ChatHandler(player->GetSession()).SendSysMessage("Your adventure begins young one!");
|
ChatHandler(player->GetSession()).SendSysMessage("Your adventure begins young one!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnLevelChanged(Player* player, uint8 /*oldLevel*/) override
|
void OnPlayerLevelChanged(Player* player, uint8 /*oldLevel*/) override
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", false))
|
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", true))
|
||||||
{
|
{
|
||||||
uint8 newLevel = player->getLevel();
|
uint8 newLevel = player->getLevel();
|
||||||
float newScale = 1.0f; // default full size
|
float newScale = 1.0f; // default full size
|
||||||
|
|||||||
Reference in New Issue
Block a user