From 442462cdcfe6215d7efd2d5bcf40a90bae6e92b6 Mon Sep 17 00:00:00 2001 From: WebLuke Date: Tue, 9 Sep 2025 12:44:01 -0600 Subject: [PATCH] first commit --- .editorconfig | 8 +++ .gitattributes | 105 ++++++++++++++++++++++++++++++++ .gitignore | 48 +++++++++++++++ LICENSE | 0 README.md | 25 ++++++++ apps/.gitkeep | 0 apps/ci/.gitkeep | 0 apps/ci/ci-codestyle.sh | 40 ++++++++++++ conf/.gitkeep | 0 conf/mod_grownup.dist | 35 +++++++++++ data/.gitkeep | 0 data/sql/db-auth/.gitkeep | 0 data/sql/db-characters/.gitkeep | 0 data/sql/db-world/.gitkeep | 0 include.sh | 0 pull_request_template.md | 25 ++++++++ src/GU_loader.cpp | 11 ++++ src/GrownUp.cpp | 77 +++++++++++++++++++++++ 18 files changed, 374 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 apps/.gitkeep create mode 100644 apps/ci/.gitkeep create mode 100644 apps/ci/ci-codestyle.sh create mode 100644 conf/.gitkeep create mode 100644 conf/mod_grownup.dist create mode 100644 data/.gitkeep create mode 100644 data/sql/db-auth/.gitkeep create mode 100644 data/sql/db-characters/.gitkeep create mode 100644 data/sql/db-world/.gitkeep create mode 100644 include.sh create mode 100644 pull_request_template.md create mode 100644 src/GU_loader.cpp create mode 100644 src/GrownUp.cpp diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eb64e2f --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7ef9001 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6e1299 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..a156f2a --- /dev/null +++ b/README.md @@ -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) \ No newline at end of file diff --git a/apps/.gitkeep b/apps/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/ci/.gitkeep b/apps/ci/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/ci/ci-codestyle.sh b/apps/ci/ci-codestyle.sh new file mode 100644 index 0000000..c96a31d --- /dev/null +++ b/apps/ci/ci-codestyle.sh @@ -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" diff --git a/conf/.gitkeep b/conf/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/mod_grownup.dist b/conf/mod_grownup.dist new file mode 100644 index 0000000..b37f8c0 --- /dev/null +++ b/conf/mod_grownup.dist @@ -0,0 +1,35 @@ +# +# Copyright (C) 2016+ AzerothCore , 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 diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-auth/.gitkeep b/data/sql/db-auth/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-characters/.gitkeep b/data/sql/db-characters/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-world/.gitkeep b/data/sql/db-world/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/include.sh b/include.sh new file mode 100644 index 0000000..e69de29 diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..21c9245 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,25 @@ + + +## Changes Proposed: +- +- + +## Issues Addressed: + +- Closes + +## SOURCE: + + +## Tests Performed: + +- +- + + +## How to Test the Changes: + + +1. +2. +3. diff --git a/src/GU_loader.cpp b/src/GU_loader.cpp new file mode 100644 index 0000000..5b81e0d --- /dev/null +++ b/src/GU_loader.cpp @@ -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(); +} + diff --git a/src/GrownUp.cpp b/src/GrownUp.cpp new file mode 100644 index 0000000..061102f --- /dev/null +++ b/src/GrownUp.cpp @@ -0,0 +1,77 @@ +/* + * Created by 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("GrownUp.Enable", false) && sConfigMgr->GetOption("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("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("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(); +}