Merge pull request #6 from milestorme/master
update mod-congrats-on-level
This commit is contained in:
commit
de10a19cea
9 changed files with 389 additions and 53 deletions
8
.editorconfig
Normal file
8
.editorconfig
Normal 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
|
||||||
49
.git_commit_template.txt
Normal file
49
.git_commit_template.txt
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
### TITLE
|
||||||
|
## Type(Scope/Subscope): Commit ultra short explanation
|
||||||
|
## |---- Write below the examples with a maximum of 50 characters ----|
|
||||||
|
## Example 1: fix(DB/SAI): Missing spell to NPC Hogger
|
||||||
|
## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros
|
||||||
|
## Example 3: feat(CORE/Commands): New GM command to do something
|
||||||
|
|
||||||
|
|
||||||
|
### DESCRIPTION
|
||||||
|
## Explain why this change is being made, what does it fix etc...
|
||||||
|
## |---- Write below the examples with a maximum of 72 characters per lines ----|
|
||||||
|
## Example: Hogger (id: 492) was not charging player when being engaged.
|
||||||
|
|
||||||
|
|
||||||
|
## Provide links to any issue, commit, pull request or other resource
|
||||||
|
## Example 1: Closes issue #23
|
||||||
|
## Example 2: Ported from other project's commit (link)
|
||||||
|
## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## =======================================================
|
||||||
|
## EXTRA INFOS
|
||||||
|
## =======================================================
|
||||||
|
## "Type" can be:
|
||||||
|
## feat (new feature)
|
||||||
|
## fix (bug fix)
|
||||||
|
## refactor (refactoring production code)
|
||||||
|
## style (formatting, missing semi colons, etc; no code change)
|
||||||
|
## docs (changes to documentation)
|
||||||
|
## test (adding or refactoring tests; no production code change)
|
||||||
|
## chore (updating bash scripts, git files etc; no production code change)
|
||||||
|
## --------------------
|
||||||
|
## Remember to
|
||||||
|
## Capitalize the subject line
|
||||||
|
## Use the imperative mood in the subject line
|
||||||
|
## Do not end the subject line with a period
|
||||||
|
## Separate subject from body with a blank line
|
||||||
|
## Use the body to explain what and why rather than how
|
||||||
|
## Can use multiple lines with "-" for bullet points in body
|
||||||
|
## --------------------
|
||||||
|
## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/
|
||||||
|
## =======================================================
|
||||||
|
## "Scope" can be:
|
||||||
|
## CORE (core related, c++)
|
||||||
|
## DB (database related, sql)
|
||||||
|
## =======================================================
|
||||||
|
## "Subscope" is optional and depends on the nature of the commit.
|
||||||
|
## =======================================================
|
||||||
105
.gitattributes
vendored
Normal file
105
.gitattributes
vendored
Normal 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
48
.gitignore
vendored
Normal 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
|
||||||
77
.travis.yml
Normal file
77
.travis.yml
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
sudo: required
|
||||||
|
dist: xenial # (16.04)
|
||||||
|
# bionic (18.04) is not yet available in travis
|
||||||
|
|
||||||
|
language: cpp
|
||||||
|
|
||||||
|
cache: ccache
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
update: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
git:
|
||||||
|
depth: 10
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- prepare_cache
|
||||||
|
- run
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: prepare_cache
|
||||||
|
env: TRAVIS_BUILD_ID="1"
|
||||||
|
before_install:
|
||||||
|
- cd ..
|
||||||
|
- git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk
|
||||||
|
- mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules
|
||||||
|
- cd azerothcore-wotlk
|
||||||
|
- source ./apps/ci/ci-before_install.sh
|
||||||
|
install:
|
||||||
|
- source ./apps/ci/ci-install.sh OFF
|
||||||
|
script:
|
||||||
|
- source ./apps/ci/ci-compile.sh
|
||||||
|
|
||||||
|
- stage: run
|
||||||
|
env: TRAVIS_BUILD_ID="1"
|
||||||
|
before_install:
|
||||||
|
- cd ..
|
||||||
|
- git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk
|
||||||
|
- mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules
|
||||||
|
- cd azerothcore-wotlk
|
||||||
|
- source ./apps/ci/ci-before_install.sh
|
||||||
|
install:
|
||||||
|
- source ./apps/ci/ci-install.sh ON
|
||||||
|
- source ./apps/ci/ci-import-db.sh
|
||||||
|
script:
|
||||||
|
- source ./apps/ci/ci-compile.sh
|
||||||
|
- source ./apps/ci/ci-worldserver-dry-run.sh
|
||||||
|
|
||||||
|
- stage: prepare_cache
|
||||||
|
env: TRAVIS_BUILD_ID="2"
|
||||||
|
before_install:
|
||||||
|
- cd ..
|
||||||
|
- git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk
|
||||||
|
- mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules
|
||||||
|
- cd azerothcore-wotlk
|
||||||
|
- source ./apps/ci/ci-before_install.sh
|
||||||
|
install:
|
||||||
|
- source ./apps/ci/ci-install.sh OFF
|
||||||
|
script:
|
||||||
|
- source ./apps/ci/ci-compile.sh
|
||||||
|
|
||||||
|
- stage: run
|
||||||
|
env: TRAVIS_BUILD_ID="2"
|
||||||
|
before_install:
|
||||||
|
- cd ..
|
||||||
|
- git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk
|
||||||
|
- mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules
|
||||||
|
- cd azerothcore-wotlk
|
||||||
|
- source ./apps/ci/ci-before_install.sh
|
||||||
|
install:
|
||||||
|
- source ./apps/ci/ci-install.sh ON
|
||||||
|
script:
|
||||||
|
- source ./apps/ci/ci-compile.sh
|
||||||
60
README.md
60
README.md
|
|
@ -1,17 +1,43 @@
|
||||||
#############################################################################################################
|
#  AzerothCore
|
||||||
|
# mod-congrats-on-level
|
||||||
____ __ ______ __ ____ __
|
### This is a module for [AzerothCore](http://www.azerothcore.org)
|
||||||
/\ _`\ /\ \__ __ /\__ _\/\ \ /\ _`\ /\ \__
|
- Latest build status with azerothcore: [](https://travis-ci.org/azerothcore/mod-congrats-on-level)
|
||||||
\ \,\L\_\ \ ,_\ __ __ __ /\_\ __ ___\/_/\ \/\ \ \___ __\ \ \L\ \ __ ____\ \ ,_\
|
#### Features:
|
||||||
\/_\__ \\ \ \/ /\ \/\ \ /'_ `\/\ \ /'__`\ /' _ `\ \ \ \ \ \ _ `\ /'__`\ \ _ <' /'__`\ /',__\\ \ \/
|
This module rewards players when they reach specific levels. It has the option to reward gold, two items, and a
|
||||||
/\ \L\ \ \ \_\ \ \_\ \/\ \L\ \ \ \/\ \L\.\_/\ \/\ \ \ \ \ \ \ \ \ \/\ __/\ \ \L\ \/\ __//\__, `\\ \ \_
|
buff or any combination. It also announces to the world when a player levels up. All rewards can be set in the
|
||||||
\ `\____\ \__\\/`____ \ \____ \ \_\ \__/.\_\ \_\ \_\ \ \_\ \ \_\ \_\ \____\\ \____/\ \____\/\____/ \ \__\
|
config file for quick modifications.
|
||||||
\/_____/\/__/ `/___/> \/___L\ \/_/\/__/\/_/\/_/\/_/ \/_/ \/_/\/_/\/____/ \/___/ \/____/\/___/ \/__/
|
|
||||||
/\___/ /\____/
|
### This module currently requires:
|
||||||
\/__/ \_/__/ http://stygianthebest.github.io
|
- AzerothCore v1.0.1+
|
||||||
|
|
||||||
#############################################################################################################
|
### How to install
|
||||||
|
1. Simply place the module under the `modules` folder of your AzerothCore source folder.
|
||||||
Modules, Scripts, and other resources for use with AzerothCore and the World of Warcraft v3.3.5a game client
|
2. Re-run cmake and launch a clean build of AzerothCore
|
||||||
|
3. Done :)
|
||||||
#############################################################################################################
|
|
||||||
|
### Usage
|
||||||
|
- Type: Player/Server
|
||||||
|
- Script: CongratsOnLevel
|
||||||
|
- Config: Yes
|
||||||
|
- Enable Module
|
||||||
|
- Enable Module Announce
|
||||||
|
- Set Items/Gold/Buffs Given At Each Level
|
||||||
|
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
- [LordPsyan](https://bitbucket.org/lordpsyan/lordpsyan-patches)
|
||||||
|
- [Blizzard Entertainment](http://blizzard.com)
|
||||||
|
- [TrinityCore](https://github.com/TrinityCore/TrinityCore/blob/3.3.5/THANKS)
|
||||||
|
- [SunwellCore](http://www.azerothcore.org/pages/sunwell.pl/)
|
||||||
|
- [AzerothCore](https://github.com/AzerothCore/azerothcore-wotlk/graphs/contributors)
|
||||||
|
- [AzerothCore Discord](https://discord.gg/gkt4y2x)
|
||||||
|
- [EMUDevs](https://youtube.com/user/EmuDevs)
|
||||||
|
- [AC-Web](http://ac-web.org/)
|
||||||
|
- [ModCraft.io](http://modcraft.io/)
|
||||||
|
- [OwnedCore](http://ownedcore.com/)
|
||||||
|
- [OregonCore](https://wiki.oregon-core.net/)
|
||||||
|
- [Wowhead.com](http://wowhead.com)
|
||||||
|
- [AoWoW](https://wotlk.evowow.com/)
|
||||||
|
- [Stygianthebest]( http://stygianthebest.github.io)
|
||||||
|
|
||||||
|
AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ Congrats.Announce = 1
|
||||||
Congrats.L10M = 1;
|
Congrats.L10M = 1;
|
||||||
Congrats.L10S = 20217
|
Congrats.L10S = 20217
|
||||||
Congrats.L101 = 3419
|
Congrats.L101 = 3419
|
||||||
Congrats.L102 = 45062
|
Congrats.L102 = 45063
|
||||||
|
|
||||||
# Level 20
|
# Level 20
|
||||||
# 10 Gold / Power Word Fortitude
|
# 10 Gold / Power Word Fortitude
|
||||||
|
|
|
||||||
4
setup_git_commit_template.sh
Normal file
4
setup_git_commit_template.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## Set a local git commit template
|
||||||
|
git config --local commit.template ".git_commit_template.txt" ;
|
||||||
|
|
@ -60,8 +60,58 @@ config file for quick modifications.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Configuration/Config.h"
|
||||||
|
#include "ScriptMgr.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
#include "Chat.h"
|
||||||
|
|
||||||
|
bool CongratsEnable = true;
|
||||||
|
bool CongratsAnnounceModule = true;
|
||||||
|
|
||||||
|
class CongratsConfig : public WorldScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CongratsConfig() : WorldScript("CongratsConfig") { }
|
||||||
|
|
||||||
|
void OnBeforeConfigLoad(bool reload) override
|
||||||
|
{
|
||||||
|
if (!reload) {
|
||||||
|
std::string conf_path = _CONF_DIR;
|
||||||
|
std::string cfg_file = conf_path + "/mod_congratsonlevel.conf";
|
||||||
|
|
||||||
|
std::string cfg_def_file = cfg_file + ".dist";
|
||||||
|
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
||||||
|
sConfigMgr->LoadMore(cfg_file.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load Configuration Settings
|
||||||
|
void SetInitialWorldSettings()
|
||||||
|
{
|
||||||
|
CongratsEnable = sConfigMgr->GetBoolDefault("Congrats.Enable", true);
|
||||||
|
CongratsAnnounceModule = sConfigMgr->GetBoolDefault("Congrats.Announce", true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CongratsAnnounce : public PlayerScript
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
CongratsAnnounce() : PlayerScript("CongratsAnnounce") {}
|
||||||
|
|
||||||
|
void OnLogin(Player* player)
|
||||||
|
{
|
||||||
|
// Announce Module
|
||||||
|
if (CongratsEnable)
|
||||||
|
{
|
||||||
|
if (CongratsAnnounceModule)
|
||||||
|
{
|
||||||
|
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00CongratsOnLevel |rmodule.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class CongratsOnLevel : public PlayerScript
|
class CongratsOnLevel : public PlayerScript
|
||||||
{
|
{
|
||||||
|
|
@ -69,18 +119,6 @@ class CongratsOnLevel : public PlayerScript
|
||||||
public:
|
public:
|
||||||
CongratsOnLevel() : PlayerScript("CongratsOnLevel") { }
|
CongratsOnLevel() : PlayerScript("CongratsOnLevel") { }
|
||||||
|
|
||||||
// Announce Module
|
|
||||||
void OnLogin(Player *player)
|
|
||||||
{
|
|
||||||
if (sConfigMgr->GetBoolDefault("Congrats.Enable", true))
|
|
||||||
{
|
|
||||||
if (sConfigMgr->GetBoolDefault("Congrats.Announce", true))
|
|
||||||
{
|
|
||||||
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00CongratsOnLevel |rmodule.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Level Up Rewards
|
// Level Up Rewards
|
||||||
void OnLevelChanged(Player* player, uint8 oldLevel)
|
void OnLevelChanged(Player* player, uint8 oldLevel)
|
||||||
{
|
{
|
||||||
|
|
@ -254,7 +292,7 @@ public:
|
||||||
// Issue a raid warning to the player
|
// Issue a raid warning to the player
|
||||||
std::ostringstream ss2;
|
std::ostringstream ss2;
|
||||||
ss2 << "Congrats on Level " << level << " " << player->GetName() << "! You've been awarded " << money << " gold and a few treasures!";
|
ss2 << "Congrats on Level " << level << " " << player->GetName() << "! You've been awarded " << money << " gold and a few treasures!";
|
||||||
player->GetSession()->SendNotification(ss2.str().c_str());
|
player->GetSession()->SendNotification(SERVER_MSG_STRING, ss2.str().c_str());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -262,29 +300,10 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CongratsOnLevelWorld : public WorldScript
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CongratsOnLevelWorld() : WorldScript("CongratsOnLevelWorld") { }
|
|
||||||
|
|
||||||
void OnBeforeConfigLoad(bool reload) override
|
|
||||||
{
|
|
||||||
if (!reload) {
|
|
||||||
std::string conf_path = _CONF_DIR;
|
|
||||||
std::string cfg_file = conf_path + "/mod_congratsonlevel.conf";
|
|
||||||
#ifdef WIN32
|
|
||||||
cfg_file = "mod_congratsonlevel.conf";
|
|
||||||
#endif
|
|
||||||
std::string cfg_def_file = cfg_file + ".dist";
|
|
||||||
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
|
||||||
|
|
||||||
sConfigMgr->LoadMore(cfg_file.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void AddCongratsOnLevelScripts()
|
void AddCongratsOnLevelScripts()
|
||||||
{
|
{
|
||||||
new CongratsOnLevelWorld();
|
new CongratsConfig();
|
||||||
|
new CongratsAnnounce();
|
||||||
new CongratsOnLevel();
|
new CongratsOnLevel();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue