updated gitignore to include modules
This commit is contained in:
8
modules/mod-auto-resurrect/.editorconfig
Normal file
8
modules/mod-auto-resurrect/.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
|
||||
45
modules/mod-auto-resurrect/.git_commit_template.txt
Normal file
45
modules/mod-auto-resurrect/.git_commit_template.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
### 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
modules/mod-auto-resurrect/.gitattributes
vendored
Normal file
105
modules/mod-auto-resurrect/.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
|
||||
49
modules/mod-auto-resurrect/.github/workflows/core-build.yml
vendored
Normal file
49
modules/mod-auto-resurrect/.github/workflows/core-build.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: core-build
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
compiler: [clang]
|
||||
runs-on: ubuntu-latest
|
||||
name: ${{ matrix.compiler }}
|
||||
env:
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'azerothcore/azerothcore-wotlk'
|
||||
ref: 'master'
|
||||
submodules: 'recursive'
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
path: 'modules/skeleton-module'
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /home/runner/.ccache
|
||||
key: ccache:${{ matrix.compiler }}:${{ github.ref }}:${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache:${{ matrix.compiler }}:${{ github.ref }}
|
||||
ccache:${{ matrix.compiler }}
|
||||
- name: Configure OS
|
||||
run: source ./acore.sh install-deps
|
||||
env:
|
||||
CONTINUOUS_INTEGRATION: true
|
||||
- name: Create conf/config.sh
|
||||
run: source ./apps/ci/ci-conf.sh
|
||||
- name: Import db
|
||||
run: source ./apps/ci/ci-import-db.sh
|
||||
- name: Build
|
||||
run: source ./apps/ci/ci-compile.sh
|
||||
- name: Dry run
|
||||
run: source ./apps/ci/ci-worldserver-dry-run.sh
|
||||
- name: Check startup errors
|
||||
run: source ./apps/ci/ci-error-check.sh
|
||||
- name: Run unit tests
|
||||
run: source ./apps/ci/ci-run-unit-tests.sh
|
||||
48
modules/mod-auto-resurrect/.gitignore
vendored
Normal file
48
modules/mod-auto-resurrect/.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
|
||||
21
modules/mod-auto-resurrect/LICENSE
Normal file
21
modules/mod-auto-resurrect/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 AzerothCore
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
22
modules/mod-auto-resurrect/README.md
Normal file
22
modules/mod-auto-resurrect/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Auto Resurrect
|
||||
|
||||
## Description
|
||||
|
||||
This mod allows players to automatically resurrect at the start of an instance or raid when releasing their spirit.
|
||||
|
||||
## Requirements
|
||||
|
||||
- AzerothCore v4.0.0+
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
1) Simply `git clone` the module under the `modules` directory of your AzerothCore source or copy paste it manually.
|
||||
2) Re-run cmake and launch a clean build of AzerothCore.
|
||||
3) Go to your server configuration directory (where your `worldserver` or `worldserver.exe` is), copy `mod-auto-resurrect.conf.dist` to `mod-auto-resurrect.conf` and edit that new file
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
- [Elmegaard](https://github.com/Elmegaard) (author of the module)
|
||||
- AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd)
|
||||
4
modules/mod-auto-resurrect/conf/conf.sh.dist
Normal file
4
modules/mod-auto-resurrect/conf/conf.sh.dist
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## CUSTOM SQL - Important file used by the db_assembler.sh
|
||||
## Keep only the required variables (base sql files or updates, depending on the DB)
|
||||
57
modules/mod-auto-resurrect/conf/mod-auto-resurrect.conf.dist
Normal file
57
modules/mod-auto-resurrect/conf/mod-auto-resurrect.conf.dist
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
#
|
||||
|
||||
[worldserver]
|
||||
|
||||
########################################
|
||||
# Auto Resurrect configuration
|
||||
########################################
|
||||
#
|
||||
# AutoResurrect.Enable
|
||||
# Description: Enable or Disable the Auto Resurrect mod
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
|
||||
AutoResurrect.Enable = 0
|
||||
|
||||
#
|
||||
# AutoResurrect.Notification
|
||||
# Description: Notify players about this module on login
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
AutoResurrect.Notification = 0
|
||||
|
||||
#
|
||||
# AutoResurrect.Dungeon
|
||||
# Description: Auto resurrect in normal dungeons
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
AutoResurrect.Dungeon = 0
|
||||
|
||||
#
|
||||
# AutoResurrect.HeroicDungeon
|
||||
# Description: Auto resurrect in heroic dungeons
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
AutoResurrect.HeroicDungeon = 0
|
||||
|
||||
#
|
||||
# AutoResurrect.Raid
|
||||
# Description: Auto resurrect in raids
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
AutoResurrect.Raid = 0
|
||||
|
||||
#
|
||||
# AutoResurrect.HeroicRaid
|
||||
# Description: Auto resurrect in heroic raids
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
AutoResurrect.HeroicRaid = 0
|
||||
9
modules/mod-auto-resurrect/include.sh
Normal file
9
modules/mod-auto-resurrect/include.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MOD_AUTO_RESURRECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )"
|
||||
|
||||
source $MOD_AUTO_RESURRECT_ROOT"/conf/conf.sh.dist"
|
||||
|
||||
if [ -f $MOD_AUTO_RESURRECT_ROOT"/conf/conf.sh" ]; then
|
||||
source $MOD_AUTO_RESURRECT_ROOT"/conf/conf.sh"
|
||||
fi
|
||||
4
modules/mod-auto-resurrect/setup_git_commit_template.sh
Normal file
4
modules/mod-auto-resurrect/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" ;
|
||||
15
modules/mod-auto-resurrect/src/AR_loader.cpp
Normal file
15
modules/mod-auto-resurrect/src/AR_loader.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
// From SC
|
||||
void AddAutoResurrectScripts();
|
||||
|
||||
// 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_auto_resurrectScripts()
|
||||
{
|
||||
AddAutoResurrectScripts();
|
||||
}
|
||||
|
||||
78
modules/mod-auto-resurrect/src/mod_auto_resurrect.cpp
Normal file
78
modules/mod-auto-resurrect/src/mod_auto_resurrect.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Config.h"
|
||||
#include "Chat.h"
|
||||
|
||||
// Add player scripts
|
||||
class AutoResurrect : public PlayerScript
|
||||
{
|
||||
public:
|
||||
AutoResurrect() : PlayerScript("AutoResurrect") { }
|
||||
std::map<int, const AreaTriggerTeleport*> playerLocation = {};
|
||||
|
||||
void DebugLog(Player* player, std::string log) {
|
||||
if (sConfigMgr->GetOption<bool>("AutoResurrect.Enable", false) && sConfigMgr->GetOption<bool>("AutoResurrect.Notification", false)) {
|
||||
ChatHandler(player->GetSession()).SendSysMessage(log);
|
||||
}
|
||||
}
|
||||
|
||||
void OnLogin(Player* player) override
|
||||
{
|
||||
if (sConfigMgr->GetOption<bool>("AutoResurrect.Enable", false) && sConfigMgr->GetOption<bool>("AutoResurrect.Notification", false))
|
||||
{
|
||||
DebugLog(player, "Auto Resurrect module enabled");
|
||||
}
|
||||
}
|
||||
|
||||
void OnPlayerReleasedGhost(Player* player) override {
|
||||
if (!sConfigMgr->GetOption<bool>("AutoResurrect.Enable", false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map* map = player->GetMap();
|
||||
|
||||
bool dungeons = sConfigMgr->GetOption<bool>("AutoResurrect.Dungeon", false);
|
||||
bool heroics = sConfigMgr->GetOption<bool>("AutoResurrect.HeroicDungeon", false);
|
||||
bool raids = sConfigMgr->GetOption<bool>("AutoResurrect.Raid", false);
|
||||
bool heroicRaids = sConfigMgr->GetOption<bool>("AutoResurrect.HeroicRaid", false);
|
||||
|
||||
if ((dungeons && !map->IsHeroic() && map->IsDungeon()) ||
|
||||
(heroics && map->IsHeroic() && map->IsDungeon()) ||
|
||||
(raids && !map->IsHeroic() && map->IsRaid()) ||
|
||||
(heroicRaids && map->IsHeroic() && map->IsRaid())) {
|
||||
AreaTriggerTeleport const* at = sObjectMgr->GetMapEntranceTrigger(player->GetMapId());
|
||||
playerLocation[player->GetGUID()] = at;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnMapChanged(Player* player) override {
|
||||
if (!sConfigMgr->GetOption<bool>("AutoResurrect.Enable", false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!playerLocation.count(player->GetGUID())) {
|
||||
return;
|
||||
}
|
||||
|
||||
AreaTriggerTeleport const* at = playerLocation[player->GetGUID()];
|
||||
if (at == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
player->ResurrectPlayer(1.0f);
|
||||
player->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
|
||||
player->SaveToDB(false, false);
|
||||
|
||||
playerLocation[player->GetGUID()] = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
// Add all scripts in one
|
||||
void AddAutoResurrectScripts()
|
||||
{
|
||||
new AutoResurrect();
|
||||
}
|
||||
Reference in New Issue
Block a user