mirror of
https://github.com/webluke/mod-grownup.git
synced 2026-01-13 01:08:39 +00:00
added more player hooks to maintain the scale when teleported, added an image of the scaling for a high level player
This commit is contained in:
BIN
grownupbig.png
Normal file
BIN
grownupbig.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 935 KiB |
@@ -16,7 +16,11 @@ 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,
|
||||||
|
PLAYERHOOK_ON_UPDATE_ZONE,
|
||||||
|
PLAYERHOOK_ON_MAP_CHANGED,
|
||||||
|
PLAYERHOOK_ON_UPDATE_AREA,
|
||||||
|
PLAYERHOOK_ON_PLAYER_RESURRECT
|
||||||
}) { }
|
}) { }
|
||||||
|
|
||||||
void OnPlayerLogin(Player* player) override
|
void OnPlayerLogin(Player* player) override
|
||||||
@@ -28,16 +32,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sConfigMgr->GetOption<bool>("GrownUp.LoginCheck", true))
|
if (sConfigMgr->GetOption<bool>("GrownUp.LoginCheck", true))
|
||||||
ApplyScale(player, false); // ensure consistency
|
ApplyScale(player, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnPlayerFirstLogin(Player* player) override
|
void OnPlayerFirstLogin(Player* player) override
|
||||||
{
|
{
|
||||||
// On very first login, set to the configured StarterMinScale
|
ApplyScale(player, true);
|
||||||
float starterMin =
|
|
||||||
sConfigMgr->GetOption<float>("GrownUp.StarterMinScale", 0.5f);
|
|
||||||
|
|
||||||
player->SetObjectScale(starterMin);
|
|
||||||
|
|
||||||
ChatHandler(player->GetSession())
|
ChatHandler(player->GetSession())
|
||||||
.PSendSysMessage("Your adventure begins small!");
|
.PSendSysMessage("Your adventure begins small!");
|
||||||
@@ -48,6 +48,26 @@ public:
|
|||||||
ApplyScale(player, true);
|
ApplyScale(player, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnPlayerUpdateZone(Player* player, uint32 /*newZone*/, uint32 /*newArea*/) override
|
||||||
|
{
|
||||||
|
ApplyScale(player, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnPlayerMapChanged(Player* player) override
|
||||||
|
{
|
||||||
|
ApplyScale(player, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnPlayerUpdateArea(Player* player, uint32 /*oldArea*/, uint32 /*newArea*/) override
|
||||||
|
{
|
||||||
|
ApplyScale(player, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnPlayerResurrect(Player* player, float /*restore_percent*/, bool /*applySickness*/) override
|
||||||
|
{
|
||||||
|
ApplyScale(player, false);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ApplyScale(Player* player, bool notify)
|
void ApplyScale(Player* player, bool notify)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user