first commit

This commit is contained in:
WebLuke
2025-09-09 12:44:01 -06:00
commit 442462cdcf
18 changed files with 374 additions and 0 deletions

8
.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
[*]
charset = utf-8
indent_style = space
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 80

105
.gitattributes vendored Normal file
View File

@@ -0,0 +1,105 @@
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto eol=lf
# Text
*.conf text
*.conf.dist text
*.cmake text
## Scripts
*.sh text
*.fish text
*.lua text
## SQL
*.sql text
## C++
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
## For documentation
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## EXECUTABLES
*.exe binary
*.pyc binary

48
.gitignore vendored Normal file
View File

@@ -0,0 +1,48 @@
!.gitignore
#
#Generic
#
.directory
.mailmap
*.orig
*.rej
*.*~
.hg/
*.kdev*
.DS_Store
CMakeLists.txt.user
*.bak
*.patch
*.diff
*.REMOTE.*
*.BACKUP.*
*.BASE.*
*.LOCAL.*
#
# IDE & other softwares
#
/.settings/
/.externalToolBuilders/*
# exclude in all levels
nbproject/
.sync.ffs_db
*.kate-swp
#
# Eclipse
#
*.pydevproject
.metadata
.gradle
tmp/
*.tmp
*.swp
*~.nib
local.properties
.settings/
.loadpath
.project
.cproject

0
LICENSE Normal file
View File

25
README.md Normal file
View File

@@ -0,0 +1,25 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore
## mod-grownup
### This is a module for [AzerothCore](http://www.azerothcore.org)
- Latest build status with azerothcore:
#### Features:
- Changes player size on initial creation, then changes their size as they level up through the first 15 levels to full size. Created for Azerothcore
### This module currently requires:
- AzerothCore vX.X.X+
### How to install
1. Simply place the module under the `modules` folder of your AzerothCore source folder.
2. Re-run cmake and launch a clean build of AzerothCore
3. Copy mod_growup.conf.dist to mod_growup.conf
4. Log in game, level up and enjoy.
## Credits
* [WebLuke]( https://github.com/WebLuke ): (Author of the module)
* Looking at other modules, and a little help from GPT-5.
* AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd)

0
apps/.gitkeep Normal file
View File

0
apps/ci/.gitkeep Normal file
View File

40
apps/ci/ci-codestyle.sh Normal file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
set -e
echo "Codestyle check script:"
echo
declare -A singleLineRegexChecks=(
["LOG_.+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above"
["[[:blank:]]$"]="Remove whitespace at the end of the lines above"
["\t"]="Replace tabs with 4 spaces in the lines above"
)
for check in ${!singleLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -P -r -I -n ${check} src; then
echo
echo "${singleLineRegexChecks[$check]}"
exit 1
fi
done
declare -A multiLineRegexChecks=(
["LOG_[^;]+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above"
["\n\n\n"]="Multiple blank lines detected, keep only one. Check the files above"
)
for check in ${!multiLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -Pzo -r -I ${check} src; then
echo
echo
echo "${multiLineRegexChecks[$check]}"
exit 1
fi
done
echo
echo "Everything looks good"

0
conf/.gitkeep Normal file
View File

35
conf/mod_grownup.dist Normal file
View File

@@ -0,0 +1,35 @@
#
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
#
[worldserver]
########################################
# Grown Up configuration
########################################
#
# GrownUp.Enable
# Description: Enable model that shrinks players on character creation and slowly increases them to normal size by level 15.
# Default: 0 - Disabled
# 1 - Enabled
#
GrownUp.Enable = 1
#
# GrownUp.Enable
# Description: Check if player size is correct on login.
# Default: 0 - Disabled
# 1 - Enabled
#
GrownUp.LoginCheck = 1
#
# GrownUp.Announce
# Description: Announce mod enabled on login.
# Default: 0 - Disabled
# 1 - Enabled
#
GrownUp.Announce = 1

0
data/.gitkeep Normal file
View File

View File

View File

View File

0
include.sh Normal file
View File

25
pull_request_template.md Normal file
View File

@@ -0,0 +1,25 @@
<!-- First of all, THANK YOU for your contribution. -->
## Changes Proposed:
-
-
## Issues Addressed:
<!-- If your fix has a relating issue, link it below -->
- Closes
## SOURCE:
<!-- If you can, include a source that can strengthen your claim -->
## Tests Performed:
<!-- Does it build without errors? Did you test in-game? What did you test? On which OS did you test? Describe any other tests performed -->
-
-
## How to Test the Changes:
<!-- Describe in a detailed step-by-step order how to test the changes -->
1.
2.
3.

11
src/GU_loader.cpp Normal file
View File

@@ -0,0 +1,11 @@
void AddGrowUpScripts();
// Add all
// cf. the naming convention https://github.com/azerothcore/azerothcore-wotlk/blob/master/doc/changelog/master.md#how-to-upgrade-4
// additionally replace all '-' in the module folder name with '_' here
void Addmod_grownupScripts()
{
AddGrowUpScripts();
}

77
src/GrownUp.cpp Normal file
View File

@@ -0,0 +1,77 @@
/*
* Created by WebLuke <https://github.com/WebLuke>
*/
#include "ScriptMgr.h"
#include "Player.h"
#include "Config.h"
#include "Chat.h"
// Add player scripts
class GrowUp : public PlayerScript
{
public:
GrowUp() : PlayerScript("GrowUp") {
PLAYERHOOK_ON_LOGIN,
PLAYERHOOK_ON_FIRST_LOGIN,
PLAYERHOOK_ON_LEVEL_CHANGED
}
void OnPlayerLogin(Player* player) override
{
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", false) && sConfigMgr->GetOption<bool>("GrownUp.LoginCheck", false))
{
uint8 level = player->getLevel();
float newScale = 1.0f;
if (level < 5)
newScale = 0.5f;
else if (level < 10)
newScale = 0.65f;
else if (level < 15)
newScale = 0.85f;
else
newScale = 1.0f;
player->SetObjectScale(newScale);
}
}
void OnFirstLogin(Player* player) override
{
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", false))
{
player->SetObjectScale(0.5f);
ChatHandler(player->GetSession()).SendSysMessage("Your adventure begins young one!");
}
}
void OnLevelChanged(Player* player, uint8 /*oldLevel*/) override
{
if (sConfigMgr->GetOption<bool>("GrownUp.Enable", false))
{
uint8 newLevel = player->getLevel();
float newScale = 1.0f; // default full size
if (newLevel < 5)
newScale = 0.5f;
else if (newLevel < 10)
newScale = 0.65f;
else if (newLevel < 15)
newScale = 0.85f;
else
newScale = 1.0f;
player->SetObjectScale(newScale);
ChatHandler(player->GetSession())
.PSendSysMessage("Your adventure has grown to %.0f%%!", newScale * 100.0f);
}
}
};
// Add all scripts in one
void AddGrowUpScripts()
{
new GrowUp();
}