mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Initial commit.
This commit is contained in:
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
|
||||
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
|
||||
49
.github/workflows/core-build.yml
vendored
Normal file
49
.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
.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
|
||||
21
LICENSE
Normal file
21
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.
|
||||
32
conf/conf.sh.dist
Normal file
32
conf/conf.sh.dist
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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)
|
||||
|
||||
## BASE SQL
|
||||
|
||||
DB_AUTH_CUSTOM_PATHS+=(
|
||||
"$MOD_SKELETON_ROOT/sql/auth/base/"
|
||||
)
|
||||
|
||||
DB_CHARACTERS_CUSTOM_PATHS+=(
|
||||
"$MOD_SKELETON_ROOT/sql/characters/base/"
|
||||
)
|
||||
|
||||
DB_WORLD_CUSTOM_PATHS+=(
|
||||
"$MOD_SKELETON_ROOT/sql/world/base/"
|
||||
)
|
||||
|
||||
## UPDATES
|
||||
|
||||
DB_AUTH_UPDATES_PATHS+=(
|
||||
"$MOD_SKELETON_ROOT/sql/auth/updates/"
|
||||
)
|
||||
|
||||
DB_CHARACTERS_UPDATES_PATHS+=(
|
||||
"$MOD_SKELETON_ROOT/sql/characters/updates/"
|
||||
)
|
||||
|
||||
DB_WORLD_UPDATES_PATHS+=(
|
||||
"$MOD_SKELETON_ROOT/sql/world/updates/"
|
||||
)
|
||||
61
conf/individualProgression.conf.dist
Normal file
61
conf/individualProgression.conf.dist
Normal file
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
#
|
||||
|
||||
[worldserver]
|
||||
|
||||
########################################
|
||||
# Individual Progression Configuration
|
||||
########################################
|
||||
#
|
||||
# IndividualProgression.Enable
|
||||
# Description: Enable Individual Progression Module
|
||||
# Default: 0 - Disabled
|
||||
# 1 - Enabled
|
||||
#
|
||||
|
||||
IndividualProgression.Enable = 1
|
||||
#
|
||||
#
|
||||
# IndividualProgression.VanillaPowerAdjustment
|
||||
# Description: Adjustment to player's attack power before completing Vanilla content
|
||||
# This is meant to provide a more accurate Vanilla feeling in Vanilla content
|
||||
# Applied linearly per level between levels 20 and 60
|
||||
# Set to 1 (100% of regular damage) to disable
|
||||
#
|
||||
# Default: 0.6 - 60% of regular damage
|
||||
#
|
||||
IndividualProgression.VanillaPowerAdjustment = 0.6
|
||||
#
|
||||
#
|
||||
# IndividualProgression.VanillaHealthAdjustmnet
|
||||
# Description: Adjustment to player's max HP before completing Vanilla content
|
||||
# This is meant to provide a more accurate Vanilla feeling in Vanilla content
|
||||
# Applied linearly per level between levels 20 and 60
|
||||
# Set to 1 (100% of regular health) to disable
|
||||
#
|
||||
# Default: 0.5 - 50% of regular health
|
||||
#
|
||||
IndividualProgression.VanillaHealthAdjustment = 0.5
|
||||
#
|
||||
#
|
||||
# IndividualProgression.TBCPowerAdjustment
|
||||
# Description: Adjustment to player's attack power before completing TBC content
|
||||
# This is meant to provide a more accurate TBC feeling in TBC content
|
||||
# Unlike Vanilla adjustment, a flat value is always used
|
||||
# Set to 1 (100% of regular damage) to disable
|
||||
#
|
||||
# Default: 0.8 - 80% of regular damage
|
||||
#
|
||||
IndividualProgression.TBCPowerAdjustment = 0.8
|
||||
#
|
||||
#
|
||||
# IndividualProgression.TBCHealthAdjustment
|
||||
# Description: Adjustment to player's max HP before completing TBC content
|
||||
# This is meant to provide a more accurate TBC feeling in TBC content
|
||||
# Unlike Vanilla adjustment, a flat value is always used
|
||||
# Set to 1 (100% of regular health) to disable
|
||||
#
|
||||
# Default: 0.7 - 70% of regular health
|
||||
#
|
||||
IndividualProgression.VanillaHealthAdjustment = 0.7
|
||||
10
include.sh
Normal file
10
include.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## GETS THE CURRENT MODULE ROOT DIRECTORY
|
||||
MOD_SKELETON_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )"
|
||||
|
||||
source $MOD_SKELETON_ROOT"/conf/conf.sh.dist"
|
||||
|
||||
if [ -f $MOD_SKELETON_ROOT"/conf/conf.sh" ]; then
|
||||
source $MOD_SKELETON_ROOT"/conf/conf.sh"
|
||||
fi
|
||||
0
sql/auth/updates/.gitkeep
Normal file
0
sql/auth/updates/.gitkeep
Normal file
0
sql/characters/updates/.gitkeep
Normal file
0
sql/characters/updates/.gitkeep
Normal file
0
sql/world/updates/.gitkeep
Normal file
0
sql/world/updates/.gitkeep
Normal file
93
src/IndividualProgression.cpp
Normal file
93
src/IndividualProgression.cpp
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "IndividualProgression.h"
|
||||
|
||||
static float vanillaPowerAdjustment, vanillaHealthAdjustment, tbcPowerAdjustment, tbcHealthAdjustment;
|
||||
static bool enabled;
|
||||
|
||||
class IndividualPlayerProgression_WorldScript : public WorldScript
|
||||
{
|
||||
private:
|
||||
void LoadConfig()
|
||||
{
|
||||
enabled = sConfigMgr->GetOption<bool>("IndividualProgression.Enabled", true);
|
||||
vanillaPowerAdjustment = sConfigMgr->GetOption<float>("IndividualProgression.VanillaPowerAdjustment", 1);
|
||||
vanillaHealthAdjustment = sConfigMgr->GetOption<float>("IndividualProgression.VanillaHealthAdjustment", 1);
|
||||
tbcPowerAdjustment = sConfigMgr->GetOption<float>("IndividualProgression.TBCPowerAdjustment", 1);
|
||||
tbcHealthAdjustment = sConfigMgr->GetOption<float>("IndividualProgression.TBCHealthAdjustment", 1);
|
||||
}
|
||||
|
||||
public:
|
||||
IndividualPlayerProgression_WorldScript() : WorldScript("IndividualPowerProgression_WorldScript") { }
|
||||
|
||||
void OnBeforeConfigLoad(bool /*reload*/) override
|
||||
{
|
||||
LoadConfig();
|
||||
}
|
||||
};
|
||||
// Add player scripts
|
||||
class IndividualPlayerProgression : public PlayerScript
|
||||
{
|
||||
private:
|
||||
void hasPassedProgression(Player* player, ProgressionState state)
|
||||
{
|
||||
return player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE) >= state;
|
||||
}
|
||||
void UpdateProgressionState(Player* player, ProgressionState newState)
|
||||
{
|
||||
uint8 currentState = player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE);
|
||||
if (newState > currentState)
|
||||
{
|
||||
player->UpdatePlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE, newState);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
IndividualPlayerProgression() : PlayerScript("IndividualProgression") { }
|
||||
|
||||
void OnAfterUpdateAttackPowerAndDamage(Player* player, float& /*level*/, float& base_attPower, float& attPowerMod, float& attPowerMultiplier, bool /*ranged*/) override
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Player is still in Vanilla content - give Vanilla damage adjustment
|
||||
if (!hasPassedProgression(player, PROGRESSION_NAXX40))
|
||||
{
|
||||
base_attPower *= vanillaPowerAdjustment;
|
||||
}
|
||||
// Player is in TBC content - give TBC damage adjustment
|
||||
else if (!hasPassedProgression(player, PROGRESSION_TBC_TIER_5))
|
||||
{
|
||||
base_attPower *= tbcPowerAdjustment;
|
||||
}
|
||||
}
|
||||
|
||||
void OnAfterUpdateMaxHealth(Player* player, float& value) override
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Player is still in Vanilla content - give Vanilla damage adjustment
|
||||
if (!hasPassedProgression(player, PROGRESSION_NAXX40))
|
||||
{
|
||||
value *= vanillaHealthAdjustment;
|
||||
}
|
||||
// Player is in TBC content - give TBC damage adjustment
|
||||
else if (!hasPassedProgression(player, PROGRESSION_TBC_TIER_5))
|
||||
{
|
||||
value *= tbcHealthAdjustment;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
// Add all scripts in one
|
||||
void AddSC_mod_individual_progression()
|
||||
{
|
||||
new IndividualPlayerProgression();
|
||||
}
|
||||
35
src/IndividualProgression.h
Normal file
35
src/IndividualProgression.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef AZEROTHCORE_INDIVIDUALPROGRESSION_H
|
||||
#define AZEROTHCORE_INDIVIDUALPROGRESSION_H
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Config.h"
|
||||
#include "Chat.h"
|
||||
|
||||
enum ProgressionSettings
|
||||
{
|
||||
SETTING_PROGRESSION_STATE = 0
|
||||
};
|
||||
|
||||
enum ProgressionState : uint8
|
||||
{
|
||||
PROGRESSION_START = 0,
|
||||
PROGRESSION_MOLTEN_CORE = 1,
|
||||
PROGRESSION_ONYXIA = 2,
|
||||
PROGRESSION_BLACKWING_LAIR = 3,
|
||||
PROGRESSION_PRE_AQ = 4,
|
||||
PROGRESSION_AQ = 5,
|
||||
PROGRESSION_NAXX40 = 6,
|
||||
PROGRESSION_TBC_TIER_1 = 7, // Karazhan, Gruul's Lair, Magtheridon's Lair
|
||||
PROGRESSION_TBC_TIER_2 = 8, // Serpentshrine Cavern, Tempest Keep
|
||||
PROGRESSION_TBC_TIER_3 = 9, // Hyjal Summit and Black Temple
|
||||
PROGRESSION_TBC_TIER_4 = 10, // Zul'Aman
|
||||
PROGRESSION_TBC_TIER_5 = 11, // Sunwell Plateau
|
||||
PROGRESSION_WOTLK_TIER_1 = 12, // WotLK Naxx, EoE, OS
|
||||
PROGRESSION_WOTLK_TIER_2 = 13, // Ulduar
|
||||
PROGRESSION_WOTLK_TIER_3 = 14, // TotC
|
||||
PROGRESSION_WOTLK_TIER_4 = 15, // ICC
|
||||
PROGRESSION_WOTLK_TIER_5 = 16 // Ruby Sanctum
|
||||
};
|
||||
|
||||
#endif //AZEROTHCORE_INDIVIDUALPROGRESSION_H
|
||||
12
src/IndividualProgression_loader.cpp
Normal file
12
src/IndividualProgression_loader.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* 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 AddSC_mod_individual_progression();
|
||||
|
||||
void Addmod_individual_progressionScripts()
|
||||
{
|
||||
AddSC_mod_individual_progression();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user