├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── feature_request.yml ├── README.md └── workflows │ └── core-build.yml ├── .gitignore ├── LICENSE ├── conf └── dynamicxp.conf.dist ├── include.sh ├── pull_request_template.md └── src ├── DXP_loader.cpp └── dynamicxp.cpp /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Create a bug report to help us improve. 3 | title: "Bug: " 4 | body: 5 | - type: textarea 6 | id: current 7 | attributes: 8 | label: Current Behaviour 9 | description: | 10 | Description of the problem or issue here. 11 | Include entries of affected creatures / items / quests / spells etc. 12 | If this is a crash, post the crashlog (upload to https://gist.github.com/) and include the link here. 13 | Never upload files! Use GIST for text and YouTube for videos! 14 | validations: 15 | required: true 16 | - type: textarea 17 | id: expected 18 | attributes: 19 | label: Expected Behaviour 20 | description: | 21 | Tell us what should happen instead. 22 | validations: 23 | required: true 24 | - type: textarea 25 | id: reproduce 26 | attributes: 27 | label: Steps to reproduce the problem 28 | description: | 29 | What does someone else need to do to encounter the same bug? 30 | placeholder: | 31 | 1. Step 1 32 | 2. Step 2 33 | 3. Step 3 34 | validations: 35 | required: true 36 | - type: textarea 37 | id: extra 38 | attributes: 39 | label: Extra Notes 40 | description: | 41 | Do you have any extra notes that can help solve the issue that does not fit any other field? 42 | placeholder: | 43 | None 44 | validations: 45 | required: false 46 | - type: textarea 47 | id: commit 48 | attributes: 49 | label: AC rev. hash/commit 50 | description: | 51 | Copy the result of the `.server debug` command (if you need to run it from the client get a prat addon) 52 | validations: 53 | required: true 54 | - type: input 55 | id: os 56 | attributes: 57 | label: Operating system 58 | description: | 59 | The Operating System the Server is running on. 60 | i.e. Windows 11 x64, Debian 10 x64, macOS 12, Ubuntu 20.04 61 | validations: 62 | required: true 63 | - type: textarea 64 | id: custom 65 | attributes: 66 | label: Custom changes or Modules 67 | description: | 68 | List which custom changes or modules you have applied, i.e. Eluna module, etc. 69 | placeholder: | 70 | None 71 | validations: 72 | required: false 73 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for this project 3 | title: "Feature: " 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thank you for taking your time to fill out a feature request. Remember to fill out all fields including the title above. 9 | An issue that is not properly filled out will be closed. 10 | - type: textarea 11 | id: description 12 | attributes: 13 | label: Describe your feature request or suggestion in detail 14 | description: | 15 | A clear and concise description of what you want to happen. 16 | validations: 17 | required: true 18 | - type: textarea 19 | id: solution 20 | attributes: 21 | label: Describe a possible solution to your feature or suggestion in detail 22 | description: | 23 | A clear and concise description of any alternative solutions or features you've considered. 24 | validations: 25 | required: false 26 | - type: textarea 27 | id: additional 28 | attributes: 29 | label: Additional context 30 | description: | 31 | Add any other context or screenshots about the feature request here. 32 | validations: 33 | required: false 34 | -------------------------------------------------------------------------------- /.github/README.md: -------------------------------------------------------------------------------- 1 | # ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore 2 | 3 | # Dynamic XP 4 | 5 | - Latest build status with azerothcore: 6 | 7 | [![Build Status](https://github.com/azerothcore/mod-dynamic-xp/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-dynamic-xp) 8 | 9 | ## Description 10 | 11 | Set xp per level range e.g in dynamicxp.conf. 12 | 13 | ## Features 14 | 15 | - Dynamic.XP.Rate.1-9 = 1.0 16 | - Dynamic.XP.Rate.10-19 = 2.0 17 | - Dynamic.XP.Rate.20-29 = 3.0 18 | - Dynamic.XP.Rate.30-39 = 4.0 19 | - Dynamic.XP.Rate.40-49 = 5.0 20 | - Dynamic.XP.Rate.50-59 = 6.0 21 | - Dynamic.XP.Rate.60-69 = 7.0 22 | - Dynamic.XP.Rate.70-79 = 8.0 23 | 24 | ## Credits 25 | 26 | - [Micrah/Milestorme: Script/Module Creator](https://github.com/milestorme). 27 | - [Poszer: Script Support](https://github.com/poszer) 28 | - [Conan513: Original Script from AshmaneCore](https://github.com/conan513). 29 | -------------------------------------------------------------------------------- /.github/workflows/core-build.yml: -------------------------------------------------------------------------------- 1 | name: core-build 2 | on: 3 | push: 4 | branches: 5 | - 'master' 6 | pull_request: 7 | 8 | jobs: 9 | build: 10 | uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main 11 | with: 12 | module_repo: ${{ github.event.repository.name }} 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | 3 | # 4 | #Generic 5 | # 6 | 7 | .directory 8 | .mailmap 9 | *.orig 10 | *.rej 11 | *~ 12 | .hg/ 13 | *.kdev* 14 | .DS_Store 15 | CMakeLists.txt.user 16 | *.bak 17 | *.patch 18 | *.diff 19 | *.REMOTE.* 20 | *.BACKUP.* 21 | *.BASE.* 22 | *.LOCAL.* 23 | 24 | # 25 | # IDE & other softwares 26 | # 27 | /.settings/ 28 | /.externalToolBuilders/* 29 | # exclude in all levels 30 | nbproject/ 31 | .sync.ffs_db 32 | *.kate-swp 33 | 34 | # 35 | # Eclipse 36 | # 37 | *.pydevproject 38 | .metadata 39 | .gradle 40 | tmp/ 41 | *.tmp 42 | *.swp 43 | *~.nib 44 | local.properties 45 | .settings/ 46 | .loadpath 47 | .project 48 | .cproject 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Micrah 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /conf/dynamicxp.conf.dist: -------------------------------------------------------------------------------- 1 | [worldserver] 2 | 3 | ################################################################################################################ 4 | # Dynamic.XP.Rate 5 | # Description: You can setup the personal XP rate for different level ranges. 6 | # 7 | # Dynamic.XP.Rate.Announce: 1 (Enable) Default 8 | # 0 (Disable) 9 | # 10 | # Dynamic.XP.Rate: 1 (Enable) Default 11 | # 0 (Disable) 12 | # 13 | # Dynamic.XP.Rate.X-X: 1+ (Set a custom XP rate on that level range) 14 | # 0 (Reset custom XP rate to default on that level range) 15 | # 16 | 17 | Dynamic.XP.Rate.Announce = 1 18 | 19 | Dynamic.XP.Rate = 1 20 | 21 | Dynamic.XP.Rate.1-9 = 1 22 | Dynamic.XP.Rate.10-19 = 2 23 | Dynamic.XP.Rate.20-29 = 3 24 | Dynamic.XP.Rate.30-39 = 4 25 | Dynamic.XP.Rate.40-49 = 5 26 | Dynamic.XP.Rate.50-59 = 6 27 | Dynamic.XP.Rate.60-69 = 7 28 | Dynamic.XP.Rate.70-79 = 8 29 | 30 | ################################################################################################################## 31 | -------------------------------------------------------------------------------- /include.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azerothcore/mod-dynamic-xp/56033ee97fe400898aea057596e933062821d13e/include.sh -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Changes Proposed: 4 | - 5 | - 6 | 7 | ## Issues Addressed: 8 | 9 | - Closes 10 | 11 | ## SOURCE: 12 | 13 | 14 | ## Tests Performed: 15 | 16 | - 17 | - 18 | 19 | 20 | ## How to Test the Changes: 21 | 22 | 23 | 1. 24 | 2. 25 | 3. 26 | -------------------------------------------------------------------------------- /src/DXP_loader.cpp: -------------------------------------------------------------------------------- 1 | void AddSC_dynamic_xp_rate(); 2 | 3 | void Addmod_dynamic_xpScripts() 4 | { 5 | AddSC_dynamic_xp_rate(); 6 | } 7 | -------------------------------------------------------------------------------- /src/dynamicxp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Credits 3 | Script reworked by Micrah/Milestorme and Poszer (Poszer is the Best) 4 | Module Created by Micrah/Milestorme 5 | Original Script from AshmaneCore https://github.com/conan513 Single Player Project 6 | */ 7 | 8 | #include "Chat.h" 9 | #include "Configuration/Config.h" 10 | #include "Player.h" 11 | #include "ScriptMgr.h" 12 | 13 | class spp_dynamic_xp_rate : public PlayerScript 14 | { 15 | public: 16 | spp_dynamic_xp_rate() : PlayerScript("spp_dynamic_xp_rate", { 17 | PLAYERHOOK_ON_LOGIN, 18 | PLAYERHOOK_ON_GIVE_EXP 19 | }) { }; 20 | 21 | void OnPlayerLogin(Player* player) override 22 | { 23 | if (sConfigMgr->GetOption("Dynamic.XP.Rate.Announce", true)) 24 | ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00Level Dynamic XP |rmodule."); 25 | } 26 | 27 | void OnPlayerGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override 28 | { 29 | if (sConfigMgr->GetOption("Dynamic.XP.Rate", true)) 30 | { 31 | if (player->GetLevel() <= 9) 32 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.1-9", 1); 33 | else if (player->GetLevel() <= 19) 34 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.10-19", 2); 35 | else if (player->GetLevel() <= 29) 36 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.20-29", 3); 37 | else if (player->GetLevel() <= 39) 38 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.30-39", 4); 39 | else if (player->GetLevel() <= 49) 40 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.40-49", 5); 41 | else if (player->GetLevel() <= 59) 42 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.50-59", 6); 43 | else if (player->GetLevel() <= 69) 44 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.60-69", 7); 45 | else if (player->GetLevel() <= 79) 46 | amount *= sConfigMgr->GetOption("Dynamic.XP.Rate.70-79", 8); 47 | } 48 | } 49 | }; 50 | 51 | void AddSC_dynamic_xp_rate() 52 | { 53 | new spp_dynamic_xp_rate(); 54 | } 55 | --------------------------------------------------------------------------------