From 51412ac170db96bec9495e4fbddb5e99ce7885f9 Mon Sep 17 00:00:00 2001 From: ColdFusion <35093669+gtao725@users.noreply.github.com> Date: Sat, 13 Apr 2019 00:01:25 +0800 Subject: [PATCH 01/46] Port Styx's Solocraft Module to AC (#2) --- CMakeLists.txt | 2 +- README.md | 48 ++++- conf/Solocraft.conf.dist | 31 ++- src/Solocraft.cpp | 313 ++++++++++++++++++++----------- src/cmake/after_ws_install.cmake | 2 +- 5 files changed, 279 insertions(+), 117 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f9604e..5e39c20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,4 +3,4 @@ AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Solocraft.cpp") AC_ADD_SCRIPT_LOADER("Solocraft" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h") -CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake") +CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake") \ No newline at end of file diff --git a/README.md b/README.md index f3a5b79..1ad20a7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,52 @@ # mod-solocraft -## Solocraft module for AzerothCore. +#### A module for AzerothCore by [StygianTheBest](https://youtu.be/fERCwTTOU3M?t=126) #### +------------------------------------------------------------------------------------------------------------------ +- Adjusts player stats for raids based on the # of players in the group +- Config: Difficulty settings for each instance type -Solocraft creates a balance based on party size in the dungeons. + +### To-Do ### +------------------------------------------------------------------------------------------------------------------ +- Verify player pets are buffed accordingly +- Dispel target regeneration +- (This is not needed in 3.3.5a) Provide unlimited http://www.wowhead.com/item=17333/aqual-quintessence + + +### Data ### +------------------------------------------------------------------------------------------------------------------ +- Type: Server/Player +- Script: Solocraft +- Config: Yes +- SQL: No + + +### Version ### +------------------------------------------------------------------------------------------------------------------ +- v2019.04.12 - Commented out unnecessary code so now the values from config file are parsed correctly +- v2017.09.04 - Add config options for difficulty levels +- v2017.09.05 - Update strings, Add module announce + + +### Credits ### +------------------------------------------------------------------------------------------------------------------ +- [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/) + + +### License ### +------------------------------------------------------------------------------------------------------------------ +- This code and content is released under the [GNU AGPL v3](https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3). # Original script: https://github.com/DavidMacalaster/Solocraft \ No newline at end of file diff --git a/conf/Solocraft.conf.dist b/conf/Solocraft.conf.dist index 1d92375..f8f48f9 100644 --- a/conf/Solocraft.conf.dist +++ b/conf/Solocraft.conf.dist @@ -1,12 +1,27 @@ [worldserver] -# ################################################################################################### - +# ____ __ ____ +# /\ _`\ /\ \__ __ /\ _`\ +# \ \,\L\_\ \ ,_\ __ __ __ /\_\ __ ___\ \ \/\_\ ___ _ __ __ +# \/_\__ \\ \ \/ /\ \/\ \ /'_ `\/\ \ /'__`\ /' _ `\ \ \/_/_ / __`\/\`'__\/'__`\ +# /\ \L\ \ \ \_\ \ \_\ \/\ \L\ \ \ \/\ \L\.\_/\ \/\ \ \ \L\ \/\ \L\ \ \ \//\ __/ +# \ `\____\ \__\\/`____ \ \____ \ \_\ \__/.\_\ \_\ \_\ \____/\ \____/\ \_\\ \____\ +# \/_____/\/__/ `/___/> \/___L\ \/_/\/__/\/_/\/_/\/_/\/___/ \/___/ \/_/ \/____/ +# /\___/ /\____/ +# \/__/ \_/__/ http://stygianthebest.github.io +################################################################################################### +# SOLOCRAFT ################################################################################################### -# -# Solocraft.Enable -# Description: Solocraft is a script to increase players and bots stats in raids, -# based on group size. It feels a little Hacky, but raids is unfair hard with playerbots. -# Default: 0 -Solocraft.Enable = 0 +# Enable the module? (1: true | 0: false) +Solocraft.Enable = 1 + +# Announce the module when the player logs in? +Solocraft.Announce = 1 + +# Difficulty Multipliers +# Defaults: 5, 10, 25, 40 +Solocraft.Dungeon = 5 +Solocraft.Heroic = 10 +Solocraft.Raid25 = 25 +Solocraft.Raid40 = 40 \ No newline at end of file diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 01e4d99..1be57b6 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -1,5 +1,47 @@ -#include +/* +# SoloCraft # +### Description ### +------------------------------------------------------------------------------------------------------------------ +- Adjusts player stats for raids based on the # of players in the group +- Config: Difficulty settings for each instance type +## To-Do ### +------------------------------------------------------------------------------------------------------------------ +- Verify player pets are buffed accordingly +- Dispel target regeneration +- (This is not needed in 3.3.5a) Provide unlimited http://www.wowhead.com/item=17333/aqual-quintessence +## Data ### +------------------------------------------------------------------------------------------------------------------ +- Type: Server/Player +- Script: Solocraft +- Config: Yes +- SQL: No +### Version ### +------------------------------------------------------------------------------------------------------------------ +- v2019.04.12 - Commented out unnecessary code so now the values from config file are parsed correctly (Lines 139-142) +- v2017.09.04 - Add config options for difficulty levels +- v2017.09.05 - Release - Update strings, Add module announce +### Credits ### +------------------------------------------------------------------------------------------------------------------ +#### A module for AzerothCore by StygianTheBest ([stygianthebest.github.io](http://stygianthebest.github.io)) #### +###### Additional Credits include: +- [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/) +### License ### +------------------------------------------------------------------------------------------------------------------ +- This code and content is released under the [GNU AGPL v3](https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3). +*/ +#include #include "Config.h" #include "ScriptMgr.h" #include "Unit.h" @@ -9,125 +51,186 @@ #include "Group.h" #include "InstanceScript.h" -/* - * TODO: - * 1. Dispel target regeneration - * 2. Provide unlimited http://www.wowhead.com/item=17333/aqual-quintessence - */ - -namespace { +bool SoloCraftEnable = 1; +bool SoloCraftAnnounceModule = 1; +uint32 D5 = 1; +uint32 D10 = 1; +uint32 D25 = 1; +uint32 D40 = 1; -class solocraft_player_instance_handler : public PlayerScript { -public: - solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") { - sLog->outString("scripts.solocraft.player.instance", "[Solocraft] solocraft_player_instance_handler Loaded"); - } - - void OnLogin(Player *player) override { - if (sConfigMgr->GetBoolDefault("Solocraft.Enable", true)) - { - ChatHandler(player->GetSession()).SendSysMessage("This server is running a Solocraft Module."); - } - } - - void OnMapChanged(Player *player) override { - if (sConfigMgr->GetBoolDefault("Solocraft.Enable", true)) { - Map *map = player->GetMap(); - int difficulty = CalculateDifficulty(map, player); - int numInGroup = GetNumInGroup(player); - ApplyBuffs(player, map, difficulty, numInGroup); - } - } -private: - std::map _unitDifficulty; - - int CalculateDifficulty(Map *map, Player *player) { - int difficulty = 1; - if (map) { - if (map->Is25ManRaid()) { - difficulty = 25; - } else if (map->IsHeroic()) { - difficulty = 10; - } else if (map->IsRaid()) { - difficulty = 40; - } else if (map->IsDungeon()) { - difficulty = 5; - } - } - return difficulty; - } - - int GetNumInGroup(Player *player) { - int numInGroup = 1; - Group *group = player->GetGroup(); - if (group) { - Group::MemberSlotList const& groupMembers = group->GetMemberSlots(); - numInGroup = groupMembers.size(); - } - return numInGroup; - } - - void ApplyBuffs(Player *player, Map *map, int difficulty, int numInGroup) { - ClearBuffs(player, map); - if (difficulty > 1) { - //InstanceMap *instanceMap = map->ToInstanceMap(); - //InstanceScript *instanceScript = instanceMap->GetInstanceScript(); - - ChatHandler(player->GetSession()).PSendSysMessage("Entered %s (difficulty = %d, numInGroup = %d)", - map->GetMapName(), difficulty, numInGroup); - - _unitDifficulty[player->GetGUID()] = difficulty; - for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) { - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(difficulty * 100), true); - } - player->SetFullHealth(); - if (player->getPowerType() == POWER_MANA) { - player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); - } - } - } - - void ClearBuffs(Player *player, Map *map) { - std::map::iterator unitDifficultyIterator = _unitDifficulty.find(player->GetGUID()); - if (unitDifficultyIterator != _unitDifficulty.end()) { - int difficulty = unitDifficultyIterator->second; - _unitDifficulty.erase(unitDifficultyIterator); - - ChatHandler(player->GetSession()).PSendSysMessage("Left to %s (removing difficulty = %d)", - map->GetMapName(), difficulty); - - for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) { - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(difficulty * 100), false); - } - } - } -}; - -} - -class SolocraftWorld : public WorldScript +class SolocraftConfig : public WorldScript { public: - SolocraftWorld() : WorldScript("SolocraftWorld") { } + SolocraftConfig() : WorldScript("SolocraftConfig") {} void OnBeforeConfigLoad(bool reload) override { if (!reload) { std::string conf_path = _CONF_DIR; std::string cfg_file = conf_path + "/Solocraft.conf"; + #ifdef WIN32 - cfg_file = "Solocraft.conf"; + cfg_file = "Solocraft.conf"; #endif - std::string cfg_def_file = cfg_file +".dist"; - sConfigMgr->LoadMore(cfg_def_file.c_str()); + std::string cfg_def_file = cfg_file + ".dist"; + sConfigMgr->LoadMore(cfg_def_file.c_str()); sConfigMgr->LoadMore(cfg_file.c_str()); + + // Load Configuration Settings + SetInitialWorldSettings(); + } + } + + // Load Configuration Settings + void SetInitialWorldSettings() + { + SoloCraftEnable = sConfigMgr->GetBoolDefault("Solocraft.Enable", 1); + SoloCraftAnnounceModule = sConfigMgr->GetBoolDefault("Solocraft.Announce", 1); + D5 = sConfigMgr->GetIntDefault("Solocraft.Dungeon", 5); + D10 = sConfigMgr->GetIntDefault("Solocraft.Heroic", 10); + D25 = sConfigMgr->GetIntDefault("Solocraft.Raid25", 25); + D40 = sConfigMgr->GetIntDefault("Solocraft.Raid40", 40); + } +}; +class SolocraftAnnounce : public PlayerScript +{ + +public: + + SolocraftAnnounce() : PlayerScript("SolocraftAnnounce") {} + + void OnLogin(Player* player) + { + // Announce Module + if (SoloCraftEnable) + { + if (SoloCraftAnnounceModule) + { + ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00SoloCraft |rmodule."); + } } } }; +class solocraft_player_instance_handler : public PlayerScript { + +public: + + solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") { + sLog->outString("scripts.solocraft.player.instance", "[Solocraft] solocraft_player_instance_handler Loaded"); + } + + void OnMapChanged(Player *player) override { + if (sConfigMgr->GetBoolDefault("Solocraft.Enable", true)) + { + Map *map = player->GetMap(); + int difficulty = CalculateDifficulty(map, player); + int numInGroup = GetNumInGroup(player); + ApplyBuffs(player, map, difficulty, numInGroup); + } + } -void AddSolocraftScripts() { - new SolocraftWorld(); - new solocraft_player_instance_handler(); -} +private: + + std::map _unitDifficulty; + +/* + uint32 D5 = 1; + uint32 D10 = 1; + uint32 D25 = 1; + uint32 D40 = 1; +*/ + + // Set the instance difficulty + int CalculateDifficulty(Map *map, Player *player) { + int difficulty = 1; + if (map) { + if (map->Is25ManRaid()) { + difficulty = D25; + } + else if (map->IsHeroic()) { + difficulty = D10; + } + else if (map->IsRaid()) { + difficulty = D40; + } + else if (map->IsDungeon()) { + difficulty = D5; + } + } + return difficulty; + } + + // Get the groups size + int GetNumInGroup(Player *player) { + int numInGroup = 1; + Group *group = player->GetGroup(); + if (group) { + Group::MemberSlotList const& groupMembers = group->GetMemberSlots(); + numInGroup = groupMembers.size(); + } + return numInGroup; + } + + // Apply the player buffs + void ApplyBuffs(Player *player, Map *map, int difficulty, int numInGroup) + { + ClearBuffs(player, map); + + if (difficulty > 1) + { + // InstanceMap *instanceMap = map->ToInstanceMap(); + // InstanceScript *instanceScript = instanceMap->GetInstanceScript(); + + // Announce to player + std::ostringstream ss; + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - # of Players: %d - Difficulty Offset: %d."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), numInGroup, difficulty); + + // Adjust player stats + _unitDifficulty[player->GetGUID()] = difficulty; + for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) + { + // Buff the player + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(difficulty * 100), true); + } + + // Set player health + player->SetFullHealth(); + if (player->getPowerType() == POWER_MANA) + { + // Buff the player's health + player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); + } + } + } + + void ClearBuffs(Player *player, Map *map) + { + std::map::iterator unitDifficultyIterator = _unitDifficulty.find(player->GetGUID()); + if (unitDifficultyIterator != _unitDifficulty.end()) + { + int difficulty = unitDifficultyIterator->second; + _unitDifficulty.erase(unitDifficultyIterator); + + // Inform the player + std::ostringstream ss; + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " exited to %s - Reverting Difficulty Offset: %d."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty); + + // Clear the buffs + for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) + { + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(difficulty * 100), false); + } + } + } +}; + +void AddSolocraftScripts() +{ + new SolocraftConfig(); + new SolocraftAnnounce(); + new solocraft_player_instance_handler(); +} \ No newline at end of file diff --git a/src/cmake/after_ws_install.cmake b/src/cmake/after_ws_install.cmake index 7bf3036..47f9f8f 100644 --- a/src/cmake/after_ws_install.cmake +++ b/src/cmake/after_ws_install.cmake @@ -12,4 +12,4 @@ if( WIN32 ) endif() endif() -install(FILES "${CMAKE_SOURCE_DIR}/modules/mod-solocraft/conf/Solocraft.conf.dist" DESTINATION ${CONF_DIR}) +install(FILES "${CMAKE_SOURCE_DIR}/modules/mod-solocraft/conf/Solocraft.conf.dist" DESTINATION ${CONF_DIR}) \ No newline at end of file From 9fe94841b11b119e263913f0742f333e5f1b5d47 Mon Sep 17 00:00:00 2001 From: Micrah <44911744+milestorme@users.noreply.github.com> Date: Fri, 23 Aug 2019 15:51:47 +1000 Subject: [PATCH 02/46] update module --- .editorconfig | 8 +++ .git_commit_template | 49 ++++++++++++++++ .gitattributes | 107 ++++++++++++++++++++++++++++++++++- .gitignore | 48 ++++++++++++++++ .travis.yml | 77 +++++++++++++++++++++++++ README.md | 53 ++++++++--------- setup_git_commit_template.sh | 4 ++ 7 files changed, 318 insertions(+), 28 deletions(-) create mode 100644 .editorconfig create mode 100644 .git_commit_template create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 setup_git_commit_template.sh 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/.git_commit_template b/.git_commit_template new file mode 100644 index 0000000..708b551 --- /dev/null +++ b/.git_commit_template @@ -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. +## ======================================================= diff --git a/.gitattributes b/.gitattributes index eba1110..7ef9001 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,105 @@ -# Auto detect text files and perform LF normalization -* text=auto \ No newline at end of file +## 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/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c1538c7 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index 1ad20a7..dbd91f2 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,34 @@ -# mod-solocraft +# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore +## mod-solocraft +### This is a module for [AzerothCore](http://www.azerothcore.org) +- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-solocraft.svg?branch=master)](https://travis-ci.org/azerothcore/mod-solocraft) + + +## Description -#### A module for AzerothCore by [StygianTheBest](https://youtu.be/fERCwTTOU3M?t=126) #### ------------------------------------------------------------------------------------------------------------------- - Adjusts player stats for raids based on the # of players in the group - Config: Difficulty settings for each instance type +## How to use ingame -### To-Do ### ------------------------------------------------------------------------------------------------------------------- -- Verify player pets are buffed accordingly -- Dispel target regeneration -- (This is not needed in 3.3.5a) Provide unlimited http://www.wowhead.com/item=17333/aqual-quintessence +1. Enable in conf +2. Enter Dungeon or Raid + +## Requirements + +- AzerothCore v1.0.1+ + + +## Installation + +``` +1) Simply place the module under the `modules` directory of your AzerothCore source. +2) Re-run cmake and launch a clean build of AzerothCore. +``` +## Edit module configuration (optional) + +If you need to change the module configuration, go to your server configuration folder (where your `worldserver` or `worldserver.exe` is), copy `emblem_transfer.conf.dist` to `emblem_transfer.conf` and edit that new file. ### Data ### ------------------------------------------------------------------------------------------------------------------ @@ -20,21 +37,12 @@ - Config: Yes - SQL: No - -### Version ### ------------------------------------------------------------------------------------------------------------------- -- v2019.04.12 - Commented out unnecessary code so now the values from config file are parsed correctly -- v2017.09.04 - Add config options for difficulty levels -- v2017.09.05 - Update strings, Add module announce - - ### Credits ### ------------------------------------------------------------------------------------------------------------------ +- [DavidMacalaster](https://github.com/DavidMacalaster/Solocraft) - [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/) @@ -42,11 +50,4 @@ - [OregonCore](https://wiki.oregon-core.net/) - [Wowhead.com](http://wowhead.com) - [AoWoW](https://wotlk.evowow.com/) - - -### License ### ------------------------------------------------------------------------------------------------------------------- -- This code and content is released under the [GNU AGPL v3](https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3). - -# Original script: -https://github.com/DavidMacalaster/Solocraft \ No newline at end of file +- AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd) diff --git a/setup_git_commit_template.sh b/setup_git_commit_template.sh new file mode 100644 index 0000000..7b52062 --- /dev/null +++ b/setup_git_commit_template.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +## Set a local git commit template +git config --local commit.template ".git_commit_template.txt" ; From dbf314706835cba439a18ebbf06361bffe2ca819 Mon Sep 17 00:00:00 2001 From: Micrah Date: Sun, 10 Nov 2019 07:57:16 +1100 Subject: [PATCH 03/46] update module --- CMakeLists.txt | 2 +- LICENSE | 153 ++++++++++++++----------------- README.md | 4 +- src/Solocraft.cpp | 57 +----------- src/cmake/after_ws_install.cmake | 15 --- 5 files changed, 77 insertions(+), 154 deletions(-) delete mode 100644 src/cmake/after_ws_install.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e39c20..b1f4add 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,4 +3,4 @@ AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Solocraft.cpp") AC_ADD_SCRIPT_LOADER("Solocraft" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h") -CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake") \ No newline at end of file +AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/Solocraft.conf.dist") \ No newline at end of file diff --git a/LICENSE b/LICENSE index 9cecc1d..dbbe355 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,17 +7,15 @@ Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and modification follow. @@ -72,7 +60,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -631,44 +629,33 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} + + Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see +For more information on this, and how to apply and follow the GNU AGPL, see . - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/README.md b/README.md index dbd91f2..49968f5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore ## mod-solocraft -### This is a module for [AzerothCore](http://www.azerothcore.org) -- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-solocraft.svg?branch=master)](https://travis-ci.org/azerothcore/mod-solocraft) +- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/milestorme/mod-solocraft.svg?branch=master)](https://travis-ci.org/milestorme/mod-solocraft) ## Description diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 1be57b6..6cf8b9e 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -1,47 +1,4 @@ -/* -# SoloCraft # -### Description ### ------------------------------------------------------------------------------------------------------------------- -- Adjusts player stats for raids based on the # of players in the group -- Config: Difficulty settings for each instance type -## To-Do ### ------------------------------------------------------------------------------------------------------------------- -- Verify player pets are buffed accordingly -- Dispel target regeneration -- (This is not needed in 3.3.5a) Provide unlimited http://www.wowhead.com/item=17333/aqual-quintessence -## Data ### ------------------------------------------------------------------------------------------------------------------- -- Type: Server/Player -- Script: Solocraft -- Config: Yes -- SQL: No -### Version ### ------------------------------------------------------------------------------------------------------------------- -- v2019.04.12 - Commented out unnecessary code so now the values from config file are parsed correctly (Lines 139-142) -- v2017.09.04 - Add config options for difficulty levels -- v2017.09.05 - Release - Update strings, Add module announce -### Credits ### ------------------------------------------------------------------------------------------------------------------- -#### A module for AzerothCore by StygianTheBest ([stygianthebest.github.io](http://stygianthebest.github.io)) #### -###### Additional Credits include: -- [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/) -### License ### ------------------------------------------------------------------------------------------------------------------- -- This code and content is released under the [GNU AGPL v3](https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3). -*/ - -#include +#include #include "Config.h" #include "ScriptMgr.h" #include "Unit.h" @@ -69,10 +26,6 @@ class SolocraftConfig : public WorldScript std::string conf_path = _CONF_DIR; std::string cfg_file = conf_path + "/Solocraft.conf"; -#ifdef WIN32 - cfg_file = "Solocraft.conf"; -#endif - std::string cfg_def_file = cfg_file + ".dist"; sConfigMgr->LoadMore(cfg_def_file.c_str()); sConfigMgr->LoadMore(cfg_file.c_str()); @@ -118,7 +71,7 @@ class solocraft_player_instance_handler : public PlayerScript { public: solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") { - sLog->outString("scripts.solocraft.player.instance", "[Solocraft] solocraft_player_instance_handler Loaded"); + // sLog->outString("scripts.solocraft.player.instance", "[Solocraft] solocraft_player_instance_handler Loaded"); } void OnMapChanged(Player *player) override { @@ -184,9 +137,9 @@ class solocraft_player_instance_handler : public PlayerScript { // InstanceScript *instanceScript = instanceMap->GetInstanceScript(); // Announce to player - std::ostringstream ss; - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - # of Players: %d - Difficulty Offset: %d."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), numInGroup, difficulty); + // std::ostringstream ss; + // ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - # of Players: %d - Difficulty Offset: %d."; + // ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), numInGroup, difficulty); // Adjust player stats _unitDifficulty[player->GetGUID()] = difficulty; diff --git a/src/cmake/after_ws_install.cmake b/src/cmake/after_ws_install.cmake deleted file mode 100644 index 47f9f8f..0000000 --- a/src/cmake/after_ws_install.cmake +++ /dev/null @@ -1,15 +0,0 @@ -if( WIN32 ) - if ( MSVC ) - add_custom_command(TARGET worldserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/modules/mod-solocraft/conf/Solocraft.conf.dist" ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ - ) - elseif ( MINGW ) - add_custom_command(TARGET worldserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/modules/mod-solocraft/conf/Solocraft.conf.dist" ${CMAKE_BINARY_DIR}/bin/ - ) - endif() -endif() - -install(FILES "${CMAKE_SOURCE_DIR}/modules/mod-solocraft/conf/Solocraft.conf.dist" DESTINATION ${CONF_DIR}) \ No newline at end of file From df6437a3ba08c967f9f474ec3f11030d28502435 Mon Sep 17 00:00:00 2001 From: Micrah <44911744+milestorme@users.noreply.github.com> Date: Sun, 10 Nov 2019 08:18:04 +1100 Subject: [PATCH 04/46] Update travis --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1538c7..9ae13a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ sudo: required -dist: xenial # (16.04) -# bionic (18.04) is not yet available in travis +dist: bionic # (18.04) language: cpp @@ -48,7 +47,7 @@ jobs: - source ./apps/ci/ci-import-db.sh script: - source ./apps/ci/ci-compile.sh - - source ./apps/ci/ci-worldserver-dry-run.sh + # - source ./apps/ci/ci-worldserver-dry-run.sh - stage: prepare_cache env: TRAVIS_BUILD_ID="2" From f6f56ebd08d4eed753f9f39f90a89c38c89da294 Mon Sep 17 00:00:00 2001 From: Micrah Date: Sun, 10 Nov 2019 08:44:55 +1100 Subject: [PATCH 05/46] fix travis error `/home/travis/build/milestorme/azerothcore-wotlk/modules/mod-solocraft/src/Solocraft.cpp:63:17: fatal error: use of undeclared identifier 'ChatHandler' ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00SoloCraft |rmodule."); ^ 1 error generated.` --- src/Solocraft.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 6cf8b9e..3862120 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -7,6 +7,7 @@ #include "Map.h" #include "Group.h" #include "InstanceScript.h" +#include "Chat.h" bool SoloCraftEnable = 1; bool SoloCraftAnnounceModule = 1; From 412c3b49873bc5d999095efca17e3423da8b5c6f Mon Sep 17 00:00:00 2001 From: Micrah Date: Sun, 10 Nov 2019 09:10:22 +1100 Subject: [PATCH 06/46] update script --- src/Solocraft.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 3862120..35915f9 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -97,7 +97,7 @@ class solocraft_player_instance_handler : public PlayerScript { */ // Set the instance difficulty - int CalculateDifficulty(Map *map, Player *player) { + int CalculateDifficulty(Map* map, Player* /*player*/) { int difficulty = 1; if (map) { if (map->Is25ManRaid()) { @@ -117,7 +117,7 @@ class solocraft_player_instance_handler : public PlayerScript { } // Get the groups size - int GetNumInGroup(Player *player) { + int GetNumInGroup(Player* player) { int numInGroup = 1; Group *group = player->GetGroup(); if (group) { @@ -128,7 +128,7 @@ class solocraft_player_instance_handler : public PlayerScript { } // Apply the player buffs - void ApplyBuffs(Player *player, Map *map, int difficulty, int numInGroup) + void ApplyBuffs(Player* player, Map* map, int difficulty, int numInGroup) { ClearBuffs(player, map); @@ -160,7 +160,7 @@ class solocraft_player_instance_handler : public PlayerScript { } } - void ClearBuffs(Player *player, Map *map) + void ClearBuffs(Player* player, Map* map) { std::map::iterator unitDifficultyIterator = _unitDifficulty.find(player->GetGUID()); if (unitDifficultyIterator != _unitDifficulty.end()) From 58dc4c1f9991fd6f272f9f4cbebed2b32e253156 Mon Sep 17 00:00:00 2001 From: Micrah Date: Sun, 10 Nov 2019 09:32:36 +1100 Subject: [PATCH 07/46] fix travis error --- src/Solocraft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 35915f9..9a2702f 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -128,7 +128,7 @@ class solocraft_player_instance_handler : public PlayerScript { } // Apply the player buffs - void ApplyBuffs(Player* player, Map* map, int difficulty, int numInGroup) + void ApplyBuffs(Player* player, Map* map, int difficulty, int /*numInGroup*/) { ClearBuffs(player, map); From 91176ae4ed436bc35c9c97224660d2402448c0e4 Mon Sep 17 00:00:00 2001 From: Micrah <44911744+milestorme@users.noreply.github.com> Date: Sat, 14 Dec 2019 20:30:58 +1100 Subject: [PATCH 08/46] update readme for merge --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 49968f5..35bc0ea 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -## mod-solocraft -- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/milestorme/mod-solocraft.svg?branch=master)](https://travis-ci.org/milestorme/mod-solocraft) +# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore +# mod-solocraft +- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-solocraft.svg?branch=master)](https://travis-ci.org/azerothcore/mod-solocraft) ## Description From 38af820fa25222764cb4d53664dccf5b7c75b8bd Mon Sep 17 00:00:00 2001 From: Micrah <44911744+milestorme@users.noreply.github.com> Date: Sat, 14 Dec 2019 20:37:45 +1100 Subject: [PATCH 09/46] enable dry_run --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9ae13a2..848d188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ jobs: - source ./apps/ci/ci-import-db.sh script: - source ./apps/ci/ci-compile.sh - # - source ./apps/ci/ci-worldserver-dry-run.sh + - source ./apps/ci/ci-worldserver-dry-run.sh - stage: prepare_cache env: TRAVIS_BUILD_ID="2" From f4ad4f130ede159fcd016bc1bc47d6a44a45dfd3 Mon Sep 17 00:00:00 2001 From: Micrah <44911744+milestorme@users.noreply.github.com> Date: Sun, 15 Dec 2019 16:44:53 +1100 Subject: [PATCH 10/46] update remove sLog , unquote announce --- src/Solocraft.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 9a2702f..d7844b2 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -71,10 +71,8 @@ class solocraft_player_instance_handler : public PlayerScript { public: - solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") { - // sLog->outString("scripts.solocraft.player.instance", "[Solocraft] solocraft_player_instance_handler Loaded"); - } - + solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") {} + void OnMapChanged(Player *player) override { if (sConfigMgr->GetBoolDefault("Solocraft.Enable", true)) { @@ -138,9 +136,9 @@ class solocraft_player_instance_handler : public PlayerScript { // InstanceScript *instanceScript = instanceMap->GetInstanceScript(); // Announce to player - // std::ostringstream ss; - // ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - # of Players: %d - Difficulty Offset: %d."; - // ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), numInGroup, difficulty); + std::ostringstream ss; + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - # of Players: %d - Difficulty Offset: %d."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), numInGroup, difficulty); // Adjust player stats _unitDifficulty[player->GetGUID()] = difficulty; @@ -187,4 +185,4 @@ void AddSolocraftScripts() new SolocraftConfig(); new SolocraftAnnounce(); new solocraft_player_instance_handler(); -} \ No newline at end of file +} From f5d8369ebd91a515745283ac36b506f8b6ebf267 Mon Sep 17 00:00:00 2001 From: Micrah <44911744+milestorme@users.noreply.github.com> Date: Mon, 16 Dec 2019 15:17:42 +1100 Subject: [PATCH 11/46] update no need to announce number of players for solo dungeons and raids --- src/Solocraft.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index d7844b2..aef526c 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -137,8 +137,8 @@ class solocraft_player_instance_handler : public PlayerScript { // Announce to player std::ostringstream ss; - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - # of Players: %d - Difficulty Offset: %d."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), numInGroup, difficulty); + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %d."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty); // Adjust player stats _unitDifficulty[player->GetGUID()] = difficulty; From e31ae91954dda96036f1e49d1a25638c600461c0 Mon Sep 17 00:00:00 2001 From: Micrah <44911744+milestorme@users.noreply.github.com> Date: Fri, 20 Dec 2019 15:30:17 +1100 Subject: [PATCH 12/46] update back to original --- LICENSE | 153 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 83 insertions(+), 70 deletions(-) diff --git a/LICENSE b/LICENSE index dbbe355..9cecc1d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,15 +7,17 @@ Preamble - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. + The GNU General Public License is a free, copyleft license for +software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to +the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -24,34 +26,44 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. @@ -60,7 +72,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU Affero General Public License. + "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -537,45 +549,35 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. + 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single +under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General +Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published +GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's +versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -629,33 +631,44 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - Copyright (C) + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + GNU General Public License for more details. - You should have received a copy of the GNU Affero General Public License + You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see +For more information on this, and how to apply and follow the GNU GPL, see . + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. From eed8b8914bb72e365a482aa171f32771029759cb Mon Sep 17 00:00:00 2001 From: Barbz Date: Sat, 21 Dec 2019 01:32:35 +0100 Subject: [PATCH 13/46] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1f4add..b6fed52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,4 +3,4 @@ AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Solocraft.cpp") AC_ADD_SCRIPT_LOADER("Solocraft" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h") -AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/Solocraft.conf.dist") \ No newline at end of file +AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/Solocraft.conf.dist") From e32eaef0fd7efb97dc78ad3061e006d7f16e5e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Sun, 30 Aug 2020 22:44:31 +0200 Subject: [PATCH 14/46] feat(CI): move from Travis to GitHub Actions (#7) --- .github/workflows/core-build.yml | 45 +++++++++++++++++++ .travis.yml | 76 -------------------------------- 2 files changed, 45 insertions(+), 76 deletions(-) create mode 100644 .github/workflows/core-build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/core-build.yml b/.github/workflows/core-build.yml new file mode 100644 index 0000000..47c5a49 --- /dev/null +++ b/.github/workflows/core-build.yml @@ -0,0 +1,45 @@ +name: core-build +on: + push: + pull_request: + +jobs: + build: + strategy: + fail-fast: false + matrix: + compiler: [clang6, clang9, clang10] + runs-on: ubuntu-20.04 + 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/mod-solocraft' + - name: Cache + uses: actions/cache@v1.1.2 + 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 ./apps/ci/ci-install.sh + env: + CONTINUOUS_INTEGRATION: true + - 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 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 848d188..0000000 --- a/.travis.yml +++ /dev/null @@ -1,76 +0,0 @@ -sudo: required -dist: bionic # (18.04) - -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 From 09deec0041d3bed8d92d838615e2c5f3e54f1ca6 Mon Sep 17 00:00:00 2001 From: Patrick Lewis Date: Sat, 21 Nov 2020 18:06:51 -0800 Subject: [PATCH 15/46] docs(readme): Update build status badge (#8) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 35bc0ea..487622d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore -# mod-solocraft -- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-solocraft.svg?branch=master)](https://travis-ci.org/azerothcore/mod-solocraft) +## mod-solocraft +- Latest build status with azerothcore: [![Build Status](https://github.com/azerothcore/mod-solocraft/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-solocraft) ## Description From bd4d5581ace54b2fb5e3d2e493ec635003b83bd0 Mon Sep 17 00:00:00 2001 From: Lanny Ellis Date: Tue, 26 Jan 2021 10:13:12 -0700 Subject: [PATCH 16/46] Fix(cpp): Login after logout will rebuff character - Before this commit: Login while being in a dungeon will not rebuff character. - Fixes #9 --- src/Solocraft.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index aef526c..cf4d230 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -128,8 +128,6 @@ class solocraft_player_instance_handler : public PlayerScript { // Apply the player buffs void ApplyBuffs(Player* player, Map* map, int difficulty, int /*numInGroup*/) { - ClearBuffs(player, map); - if (difficulty > 1) { // InstanceMap *instanceMap = map->ToInstanceMap(); @@ -156,6 +154,8 @@ class solocraft_player_instance_handler : public PlayerScript { player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); } } + else + ClearBuffs(player, map); } void ClearBuffs(Player* player, Map* map) From 8285afa2d4440ae17c1f38c029a6094ff936ba5f Mon Sep 17 00:00:00 2001 From: Lanny Ellis Date: Tue, 26 Jan 2021 11:15:29 -0700 Subject: [PATCH 17/46] Feature and Admin Upgrade/Overhaul This is a large overhaul of the Solocraft module. Features and Admin Controls added: -Groups now work. Difficulty is now distributed across group size -Debuff added for groups trying to exceed the difficulty modifier -Debuff can be enabled and disabled -Spellpower is now scaled based on character level and modifier -Stat modifier can now be changed in config to reel in melee damage -Individual modification of each dungeon/raid difficulty -Max level cap to keep high level characters from getting buffed -Max level cap modifiable in config for each dungeon/raid -Dungeon/Raid types still used as a catch all if not found as an individual instance in the config A database table is included to manage groups and the difficulty modifier that each group member has applied to them. It also deals with server restarts and players having to log out and log back in to try to correct stats. The table is required. Updated README.md file with current instructions and config file name fix. Testing: Debuff: -Character in dungeon with full difficulty modifier applied while not in a group. -Invite another character to the group. -Have new group member enter same dungeon. -Debuff will be applied because of the group member already in the dungeon has the full difficulty modifier applied. -Have both characters leave dungeon and re-enter it to have the modifier balanced across the current members of the group. -Max Level: -Solocraft.Max.Level.Diff and the Dungeon individual level are added together to declare the max level a character can be to get the difficulty modifier applied for the dungeon. -Use a character whose level is higher than the max level and enter dungeon. -Character should not receive the difficulty modifier buff for the dungeon. -Spellpower and Stats modifier adjustments: -Change modifier in the config. -Enter dungeon with character and notice stats and/or spellpower numbers changed from previous entrance into the dungeon. --- README.md | 19 +- conf/Solocraft.conf.dist | 381 +++++++++- data/sql/db-world/Solocraft.sql | 12 + src/Solocraft.cpp | 1150 +++++++++++++++++++++++++++++-- 4 files changed, 1492 insertions(+), 70 deletions(-) create mode 100644 data/sql/db-world/Solocraft.sql diff --git a/README.md b/README.md index 487622d..24381b1 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,19 @@ ## Description -- Adjusts player stats for raids based on the # of players in the group -- Config: Difficulty settings for each instance type +- Adjusts player stats for raids based on the # of players in the group - This now works. +- Configurable debuff for groups trying to overload the difficulty modifier for an instance +- Adjustable stats modifier in config +- Config: Difficulty settings for each instance and type +- Now includes a Spellpower buff: Adjustable modifier in config +- Saves your modifier settings in database. +- Max level thresholds can be set to not buff players whose level is too far over the dungeon level ## How to use ingame 1. Enable in conf -2. Enter Dungeon or Raid +2. Go into conf and set any features you want to enable or modify +3. Enter Dungeon or Raid ## Requirements @@ -22,19 +28,20 @@ ``` 1) Simply place the module under the `modules` directory of your AzerothCore source. -2) Re-run cmake and launch a clean build of AzerothCore. +2) Import the SQL to the right Database (world) +3) Re-run cmake and launch a clean build of AzerothCore. ``` ## Edit module configuration (optional) -If you need to change the module configuration, go to your server configuration folder (where your `worldserver` or `worldserver.exe` is), copy `emblem_transfer.conf.dist` to `emblem_transfer.conf` and edit that new file. +If you need to change the module configuration, go to your server configuration folder (where your worldserver or worldserver.exe is), copy Solocraft.conf.dist to Solocraft.conf and edit that new file. ### Data ### ------------------------------------------------------------------------------------------------------------------ - Type: Server/Player - Script: Solocraft - Config: Yes -- SQL: No +- SQL: Yes ### Credits ### ------------------------------------------------------------------------------------------------------------------ diff --git a/conf/Solocraft.conf.dist b/conf/Solocraft.conf.dist index f8f48f9..e866c3f 100644 --- a/conf/Solocraft.conf.dist +++ b/conf/Solocraft.conf.dist @@ -19,9 +19,382 @@ Solocraft.Enable = 1 # Announce the module when the player logs in? Solocraft.Announce = 1 + +################################################################################################### +# Balancing - Groups (Overloading), Spellpower, and Stats +################################################################################################### + +# Enable Debuff of new party members who enter the dungeon to avoid overloading the dungeon? +# Overloading is when a group member already in the dungeon has the full offset/buff of the +# dungeon applied then they invite new group members who enter the dungeon and also receive an +# offset which creates a huge imbalance. +# The debuff will make the new members weak until all members leave the instance/dungeon +# instance/dungeon and re-enter which will then split the offset among all the group members. + +# Default: 1 (on) +# 0 (off) +SoloCraft.Debuff.Enable = 1 + + +# Spellpower Bonus Multiplier +# Spellcasters spellpower bonus multiplier to offset no spellpower received from stats +# Formula: (player->level * multiplier) * difficulty +# Example Level 24 Mage with default modifier and a dungeon difficulty of 5 will receive a base +# Spellpower increase of 300. + +# Default: 2.5 +# 0.0 (Disable) +SoloCraft.Spellpower.Mult = 2.5 + + +# Stats Percentage Bonus Multiplier +# Forumla: player->Stats * (difficulty * multiplier) + +# Default: 100.0 +# 0.0 (Disable) +SoloCraft.Stats.Mult = 100.0 + + +################################################################################################ +#Catch all Bucket - Difficulty Offset Defaults +################################################################################################ + # Difficulty Multipliers # Defaults: 5, 10, 25, 40 -Solocraft.Dungeon = 5 -Solocraft.Heroic = 10 -Solocraft.Raid25 = 25 -Solocraft.Raid40 = 40 \ No newline at end of file +Solocraft.Dungeon = 5.0 +Solocraft.Heroic = 10.0 +Solocraft.Raid25 = 25.0 +Solocraft.Raid40 = 40.0 + + +################################################################################################ +#Classic Instances - Difficulty +################################################################################################ + +Solocraft.ShadowfangKeep = 5.0 +Solocraft.Stockades = 5.0 +Solocraft.Deadmines = 5.0 +Solocraft.WailingCaverns = 5.0 +Solocraft.RazorfenKraulInstance = 5.0 +Solocraft.Blackfathom = 5.0 +Solocraft.Uldaman = 5.0 +Solocraft.GnomeragonInstance = 5.0 +Solocraft.SunkenTemple = 5.0 +Solocraft.RazorfenDowns = 5.0 +# Scarlet Monastery +Solocraft.MonasteryInstances = 5.0 +# Zul'Farrak +Solocraft.TanarisInstance = 5.0 +Solocraft.BlackRockSpire = 10.0 +Solocraft.BlackrockDepths = 5.0 +Solocraft.OnyxiaLairInstance = 40.0 +#Scholomance +Solocraft.SchoolofNecromancy = 5.0 +Solocraft.Zul'gurub = 20.0 +Solocraft.Stratholme = 5.0 +Solocraft.Mauradon = 5.0 +# Ragefire Chasm +Solocraft.OrgrimmarInstance = 5.0 +Solocraft.MoltenCore = 40.0 +Solocraft.DireMaul = 5.0 +Solocraft.BlackwingLair = 40.0 +# Ruins of Ahn'Qiraj +Solocraft.AhnQiraj = 20.0 +Solocraft.AhnQirajTemple = 40.0 + + +################################################################################################ +#BC Instances - Difficulty +################################################################################################ + +# The Black Morass +Solocraft.CavernsOfTime = 5.0 +Solocraft.CavernsOfTimeH = 5.0 +Solocraft.Karazahn = 10.0 +# The Battle for Mount Hyjal - Hyjal Summit +Solocraft.HyjalPast = 25.0 +# The Shattered Halls +Solocraft.HellfireMilitary = 5.0 +Solocraft.HellfireMilitaryH = 5.0 +# The Blood Furnace +Solocraft.HellfireDemon = 5.0 +Solocraft.HellfireDemonH = 5.0 +Solocraft.HellfireRampart = 5.0 +Solocraft.HellfireRampartH = 5.0 +# Magtheridon's Lair +Solocraft.HellfireRaid = 25.0 +# The Steamvault +Solocraft.CoilfangPumping = 5.0 +Solocraft.CoilfangPumpingH = 5.0 +# The Underbog +Solocraft.CoilfangMarsh = 5.0 +Solocraft.CoilfangMarshH = 5.0 +# The Slavepens +Solocraft.CoilfangDraenei = 5.0 +Solocraft.CoilfangDraeneiH = 5.0 +# Serpentshrine Cavern +Solocraft.CoilfangRaid = 25.0 +# The Eye +Solocraft.TempestKeepRaid = 25.0 +# The Arcatraz +Solocraft.TempestKeepArcane = 5.0 +Solocraft.TempestKeepArcaneH = 5.0 +# The Botanica +Solocraft.TempestKeepAtrium = 5.0 +Solocraft.TempestKeepAtriumH = 5.0 +# The Mechanar +Solocraft.TempestKeepFactory = 5.0 +Solocraft.TempestKeepFactoryH = 5.0 +# Shadow Labyrinth +Solocraft.AuchindounShadow = 5.0 +Solocraft.AuchindounShadowH = 5.0 +# Sethekk Halls +Solocraft.AuchindounDemon = 5.0 +Solocraft.AuchindounDemonH = 5.0 +# Mana-Tombs +Solocraft.AuchindounEthereal = 5.0 +Solocraft.AuchindounEtherealH = 5.0 +# Auchenai Crypts +Solocraft.AuchindounDraenei = 5.0 +Solocraft.AuchindounDraeneiH = 5.0 +# Old Hillsbrad Foothills +Solocraft.HillsbradPast = 5.0 +Solocraft.HillsbradPastH = 5.0 +Solocraft.BlackTemple = 25.0 +Solocraft.GruulsLair = 25.0 +Solocraft.ZulAman = 5.0 +Solocraft.ZulAmanH = 5.0 +Solocraft.SunwellPlateau = 25.0 +# Magister's Terrace +Solocraft.Sunwell5ManFix = 5.0 +Solocraft.Sunwell5ManFixH = 5.0 + + +################################################################################################ +#WOTLK Instances - Difficulty +################################################################################################ + +# Naxxramas +Solocraft.StratholmeRaid = 10.0 +Solocraft.StratholmeRaidH = 25.0 +# Utgarde Keep +Solocraft.Valgarde70 = 5.0 +Solocraft.Valgarde70H = 5.0 +Solocraft.UtgardePinnacle = 5.0 +Solocraft.UtgardePinnacleH = 5.0 +# The Nexus +Solocraft.Nexus70 = 5.0 +Solocraft.Nexus70H = 5.0 +# The Occulus +Solocraft.Nexus80 = 5.0 +Solocraft.Nexus80H = 5.0 +# The Culling of Stratholme +Solocraft.StratholmeCOT = 5.0 +Solocraft.StratholmeCOTH = 5.0 +# Halls of Stone +Solocraft.Ulduar70 = 5.0 +Solocraft.Ulduar70H = 5.0 +# Drak'Tharon Keep +Solocraft.DrakTheronKeep = 5.0 +Solocraft.DrakTheronKeepH = 5.0 +# Azjol-Nerub +Solocraft.Azjol_Uppercity = 5.0 +Solocraft.Azjol_UppercityH = 5.0 +# Halls of Lighting +Solocraft.Ulduar80 = 5.0 +Solocraft.Ulduar80H = 5.0 +# Ulduar +Solocraft.UlduarRaid = 10.0 +Solocraft.UlduarRaidH = 25.0 +Solocraft.GunDrak = 5.0 +Solocraft.GunDrakH = 5.0 +# Violet Hold +Solocraft.DalaranPrison = 5.0 +Solocraft.DalaranPrisonH = 5.0 +# The Obsidian Sanctum +Solocraft.ChamberOfAspectsBlack = 10.0 +Solocraft.ChamberOfAspectsBlackH = 25.0 +# The Eye of Eternity +Solocraft.NexusRaid = 10.0 +Solocraft.NexusRaidH = 25.0 +# Ahn'kahet: The Old Kingdom +Solocraft.Azjol_LowerCity = 5.0 +Solocraft.Azjol_LowerCityH = 5.0 +Solocraft.IcecrownCitadel = 10.0 +Solocraft.IcecrownCitadelH = 25.0 +# The Forge of Souls +Solocraft.IcecrownCitadel5Man = 5.0 +Solocraft.IcecrownCitadel5ManH = 5.0 +# Trial of the Crusader +Solocraft.ArgentTournamentRaid = 10.0 +Solocraft.ArgentTournamentRaidH = 25.0 +# Grand Trial of the Crusader Heroic +Solocraft.ArgentTournamentRaidH10 = 10.0 +Solocraft.ArgentTournamentRaidH25 = 25.0 +# Trial of the Champion +Solocraft.ArgentTournamentDungeon = 5.0 +Solocraft.ArgentTournamentDungeonH = 5.0 +# Pit of Saron +Solocraft.QuarryOfTears = 5.0 +Solocraft.QuarryOfTearsH = 5.0 +# Halls of Reflection +Solocraft.HallsOfReflection = 5.0 +Solocraft.HallsOfReflectionH = 5.0 +# The Ruby Sanctum +Solocraft.ChamberOfAspectsRed = 5.0 +Solocraft.ChamberOfAspectsRedH = 5.0 + + +################################################################################################ +#Player Level Thresholds +################################################################################################ + +#Max player level difference over the Dungeon's Level for Solocraft to apply the +# difficulty offset buff. +# Default: 10 +# Disable: 80 +Solocraft.Max.Level.Diff = 10 + + +################################################################################################ +#Dungeon Base Levels +################################################################################################ + +#Catch All - Default 80 +Solocraft.Dungeon.Level = 80 + + +################################################################################################ +#Classic Instances - Base Level +################################################################################################ + +Solocraft.ShadowfangKeep.Level = 15 +Solocraft.Stockades.Level = 22 +Solocraft.Deadmines.Level = 18 +Solocraft.WailingCaverns.Level = 17 +Solocraft.RazorfenKraulInstance.Level = 30 +Solocraft.Blackfathom.Level = 20 +Solocraft.Uldaman.Level = 40 +Solocraft.GnomeragonInstance.Level = 24 +Solocraft.SunkenTemple.Level = 50 +Solocraft.RazorfenDowns.Level = 40 +# Scarlet Monastery +Solocraft.MonasteryInstances.Level = 35 +# Zul'Farrak +Solocraft.TanarisInstance.Level = 44 +Solocraft.BlackRockSpire.Level = 55 +Solocraft.BlackrockDepths.Level = 50 +Solocraft.OnyxiaLairInstance.Level = 60 +#Scholomance +Solocraft.SchoolofNecromancy.Level = 55 +Solocraft.Zul'gurub.Level = 60 +Solocraft.Stratholme.Level = 55 +Solocraft.Mauradon.Level = 48 +# Ragefire Chasm +Solocraft.OrgrimmarInstance.Level = 15 +Solocraft.MoltenCore.Level = 60 +Solocraft.DireMaul.Level = 48 +Solocraft.BlackwingLair.Level = 40 +# Ruins of Ahn'Qiraj +Solocraft.AhnQiraj.Level = 60 +Solocraft.AhnQirajTemple.Level = 60 + + +################################################################################################ +#BC Instances - Base Level +################################################################################################ + +# The Black Morass +Solocraft.CavernsOfTime.Level = 68 +Solocraft.Karazahn.Level = 68 +# The Battle for Mount Hyjal - Hyjal Summit +Solocraft.HyjalPast.Level = 70 +# The Shattered Halls +Solocraft.HellfireMilitary.Level = 68 +# The Blood Furnace +Solocraft.HellfireDemon.Level = 68 +Solocraft.HellfireRampart.Level = 68 +# Magtheridon's Lair +Solocraft.HellfireRaid.Level = 68 +# The Steamvault +Solocraft.CoilfangPumping.Level = 68 +# The Underbog +Solocraft.CoilfangMarsh.Level = 68 +# The Slavepens +Solocraft.CoilfangDraenei.Level = 68 +# Serpentshrine Cavern +Solocraft.CoilfangRaid.Level = 70 +# The Eye +Solocraft.TempestKeepRaid.Level = 70 +# The Arcatraz +Solocraft.TempestKeepArcane.Level = 68 +# The Botanica +Solocraft.TempestKeepAtrium.Level = 68 +# The Mechanar +Solocraft.TempestKeepFactory.Level = 68 +# Shadow Labyrinth +Solocraft.AuchindounShadow.Level = 68 +# Sethekk Halls +Solocraft.AuchindounDemon.Level = 68 +# Mana-Tombs +Solocraft.AuchindounEthereal.Level = 68 +# Auchenai Crypts +Solocraft.AuchindounDraenei.Level = 68 +# Old Hillsbrad Foothills +Solocraft.HillsbradPast.Level = 68 +Solocraft.BlackTemple.Level = 70 +Solocraft.GruulsLair.Level = 70 +Solocraft.ZulAman.Level = 68 +Solocraft.SunwellPlateau.Level = 70 +# Magister's Terrace +Solocraft.Sunwell5ManFix.Level = 68 + + +################################################################################################ +#WOTLK Instances - Base Level +################################################################################################ + +# Naxxramas +Solocraft.StratholmeRaid.Level = 78 +# Utgarde Keep +Solocraft.Valgarde70.Level = 78 +Solocraft.UtgardePinnacle.Level = 78 +# The Nexus +Solocraft.Nexus70.Level = 78 +# The Occulus +Solocraft.Nexus80.Level = 78 +# The Culling of Stratholme +Solocraft.StratholmeCOT.Level = 78 +# Halls of Stone +Solocraft.Ulduar70.Level = 78 +# Drak'Tharon Keep +Solocraft.DrakTheronKeep.Level = 78 +# Azjol-Nerub +Solocraft.Azjol_Uppercity.Level = 78 +# Halls of Lighting +Solocraft.Ulduar80.Level = 78 +# Ulduar +Solocraft.UlduarRaid.Level = 80 +Solocraft.GunDrak.Level = 78 +# Violet Hold +Solocraft.DalaranPrison.Level = 78 +# The Obsidian Sanctum +Solocraft.ChamberOfAspectsBlack.Level = 80 +# The Eye of Eternity +Solocraft.NexusRaid.Level = 80 +# Ahn'kahet: The Old Kingdom +Solocraft.Azjol_LowerCity.Level = 78 +#Icecrown Citadel +Solocraft.IcecrownCitadel.Level = 80 +# The Forge of Souls +Solocraft.IcecrownCitadel5Man.Level = 78 +# Trial of the Champion +Solocraft.ArgentTournamentDungeon.Level = 80 +# Trial of the Crusader +Solocraft.ArgentTournamentRaid.Level = 80 +# Pit of Saron +Solocraft.QuarryOfTears.Level = 78 +# Halls of Reflection +Solocraft.HallsOfReflection.Level = 78 +# The Ruby Sanctum +Solocraft.ChamberOfAspectsRed.Level = 80 diff --git a/data/sql/db-world/Solocraft.sql b/data/sql/db-world/Solocraft.sql new file mode 100644 index 0000000..3212733 --- /dev/null +++ b/data/sql/db-world/Solocraft.sql @@ -0,0 +1,12 @@ +-- Structure for table custom_solocraft_character_stats +CREATE TABLE IF NOT EXISTS `custom_solocraft_character_stats` ( + `GUID` tinyint unsigned NOT NULL, + `Difficulty` float NOT NULL, + `GroupSize` int NOT NULL, + `SpellPower` int unsigned NOT NULL DEFAULT '0', + `Stats` float NOT NULL DEFAULT '100', + PRIMARY KEY (`GUID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +-- Data exporting was unselected. \ No newline at end of file diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index aef526c..c95e19d 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -8,13 +8,209 @@ #include "Group.h" #include "InstanceScript.h" #include "Chat.h" +#include bool SoloCraftEnable = 1; bool SoloCraftAnnounceModule = 1; -uint32 D5 = 1; -uint32 D10 = 1; -uint32 D25 = 1; -uint32 D40 = 1; +bool SoloCraftDebuffEnable = 1; +float SoloCraftSpellMult = 1.0; +float SoloCraftStatsMult = 100.0; +uint32 SolocraftLevelDiff = 1; +uint32 SolocraftDungeonLevel = 1; + +float D5 = 1.0; +float D10 = 1.0; +float D25 = 1.0; +float D40 = 1.0; +float D33 = 1.0; +float D34 = 1.0; +float D36 = 1.0; +float D43 = 1.0; +float D47 = 1.0; +float D48 = 1.0; +float D70 = 1.0; +float D90 = 1.0; +float D109 = 1.0; +float D129 = 1.0; +float D189 = 1.0; +float D209 = 1.0; +float D229 = 1.0; +float D230 = 1.0; +float D249 = 1.0; +float D289 = 1.0; +float D309 = 1.0; +float D329 = 1.0; +float D349 = 1.0; +float D389 = 1.0; +float D409 = 1.0; +float D429 = 1.0; +float D469 = 1.0; +float D509 = 1.0; +float D531 = 1.0; +float D269 = 1.0; +float D269H = 1.0; +float D532 = 1.0; +float D534 = 1.0; +float D540 = 1.0; +float D540H = 1.0; +float D542 = 1.0; +float D542H = 1.0; +float D543 = 1.0; +float D543H = 1.0; +float D544 = 1.0; +float D545 = 1.0; +float D545H = 1.0; +float D546 = 1.0; +float D546H = 1.0; +float D547 = 1.0; +float D547H = 1.0; +float D548 = 1.0; +float D550 = 1.0; +float D552 = 1.0; +float D552H = 1.0; +float D553 = 1.0; +float D553H = 1.0; +float D554 = 1.0; +float D554H = 1.0; +float D555 = 1.0; +float D555H = 1.0; +float D556 = 1.0; +float D556H = 1.0; +float D557 = 1.0; +float D557H = 1.0; +float D558 = 1.0; +float D558H = 1.0; +float D560 = 1.0; +float D560H = 1.0; +float D564 = 1.0; +float D565 = 1.0; +float D568 = 1.0; +float D568H = 1.0; +float D580 = 1.0; +float D585 = 1.0; +float D585H = 1.0; +float D533 = 1.0; +float D533H = 1.0; +float D574 = 1.0; +float D574H = 1.0; +float D575 = 1.0; +float D575H = 1.0; +float D576 = 1.0; +float D576H = 1.0; +float D578 = 1.0; +float D578H = 1.0; +float D595 = 1.0; +float D595H = 1.0; +float D599 = 1.0; +float D599H = 1.0; +float D600 = 1.0; +float D600H = 1.0; +float D601 = 1.0; +float D601H = 1.0; +float D602 = 1.0; +float D602H = 1.0; +float D603 = 1.0; +float D603H = 1.0; +float D604 = 1.0; +float D604H = 1.0; +float D608 = 1.0; +float D608H = 1.0; +float D615 = 1.0; +float D615H = 1.0; +float D616 = 1.0; +float D616H = 1.0; +float D619 = 1.0; +float D619H = 1.0; +float D631 = 1.0; +float D631H = 1.0; +float D632 = 1.0; +float D632H = 1.0; +float D649 = 1.0; +float D649H = 1.0; +float D649H10 = 1.0; +float D649H25 = 1.0; +float D650 = 1.0; +float D650H = 1.0; +float D658 = 1.0; +float D658H = 1.0; +float D668 = 1.0; +float D668H = 1.0; +float D724 = 1.0; +float D724H = 1.0; + +uint32 M33 = 1; +uint32 M34 = 1; +uint32 M36 = 1; +uint32 M43 = 1; +uint32 M47 = 1; +uint32 M48 = 1; +uint32 M70 = 1; +uint32 M90 = 1; +uint32 M109 = 1; +uint32 M129 = 1; +uint32 M189 = 1; +uint32 M209 = 1; +uint32 M229 = 1; +uint32 M230 = 1; +uint32 M249 = 1; +uint32 M289 = 1; +uint32 M309 = 1; +uint32 M329 = 1; +uint32 M349 = 1; +uint32 M389 = 1; +uint32 M409 = 1; +uint32 M429 = 1; +uint32 M469 = 1; +uint32 M509 = 1; +uint32 M531 = 1; +uint32 M269 = 1; +uint32 M532 = 1; +uint32 M534 = 1; +uint32 M540 = 1; +uint32 M542 = 1; +uint32 M543 = 1; +uint32 M544 = 1; +uint32 M545 = 1; +uint32 M546 = 1; +uint32 M547 = 1; +uint32 M548 = 1; +uint32 M550 = 1; +uint32 M552 = 1; +uint32 M553 = 1; +uint32 M554 = 1; +uint32 M555 = 1; +uint32 M556 = 1; +uint32 M557 = 1; +uint32 M558 = 1; +uint32 M560 = 1; +uint32 M564 = 1; +uint32 M565 = 1; +uint32 M568 = 1; +uint32 M580 = 1; +uint32 M585 = 1; +uint32 M533 = 1; +uint32 M574 = 1; +uint32 M575 = 1; +uint32 M576 = 1; +uint32 M578 = 1; +uint32 M595 = 1; +uint32 M599 = 1; +uint32 M600 = 1; +uint32 M601 = 1; +uint32 M602 = 1; +uint32 M603 = 1; +uint32 M604 = 1; +uint32 M608 = 1; +uint32 M615 = 1; +uint32 M616 = 1; +uint32 M619 = 1; +uint32 M631 = 1; +uint32 M632 = 1; +uint32 M649 = 1; +uint32 M650 = 1; +uint32 M658 = 1; +uint32 M668 = 1; +uint32 M724 = 1; class SolocraftConfig : public WorldScript { @@ -41,12 +237,229 @@ class SolocraftConfig : public WorldScript { SoloCraftEnable = sConfigMgr->GetBoolDefault("Solocraft.Enable", 1); SoloCraftAnnounceModule = sConfigMgr->GetBoolDefault("Solocraft.Announce", 1); - D5 = sConfigMgr->GetIntDefault("Solocraft.Dungeon", 5); - D10 = sConfigMgr->GetIntDefault("Solocraft.Heroic", 10); - D25 = sConfigMgr->GetIntDefault("Solocraft.Raid25", 25); - D40 = sConfigMgr->GetIntDefault("Solocraft.Raid40", 40); + + //Balancing + SoloCraftDebuffEnable = sConfigMgr->GetBoolDefault("SoloCraft.Debuff.Enable", 1); + SoloCraftSpellMult = sConfigMgr->GetFloatDefault("SoloCraft.Spellpower.Mult", 2.5); + SoloCraftStatsMult = sConfigMgr->GetFloatDefault("SoloCraft.Stats.Mult", 100.0); + + //Level Thresholds + SolocraftLevelDiff = sConfigMgr->GetIntDefault("Solocraft.Max.Level.Diff", 10); + + //Catch All Dungeon Level Threshold + SolocraftDungeonLevel = sConfigMgr->GetIntDefault("Solocraft.Dungeon.Level", 80); + + //Dungeon Base Level + //Wow Classic + M33 = sConfigMgr->GetIntDefault("Solocraft.ShadowfangKeep.Level", 15); + M34 = sConfigMgr->GetIntDefault("Solocraft.Stockades.Level", 22); + M36 = sConfigMgr->GetIntDefault("Solocraft.Deadmines.Level", 18); + M43 = sConfigMgr->GetIntDefault("Solocraft.WailingCaverns.Level", 17); + M47 = sConfigMgr->GetIntDefault("Solocraft.RazorfenKraulInstance.Level", 30); + M48 = sConfigMgr->GetIntDefault("Solocraft.Blackfathom.Level", 20); + M70 = sConfigMgr->GetIntDefault("Solocraft.Uldaman.Level", 40); + M90 = sConfigMgr->GetIntDefault("Solocraft.GnomeragonInstance.Level", 24); + M109 = sConfigMgr->GetIntDefault("Solocraft.SunkenTemple.Level", 50); + M129 = sConfigMgr->GetIntDefault("Solocraft.RazorfenDowns.Level", 40); + M189 = sConfigMgr->GetIntDefault("Solocraft.MonasteryInstances.Level", 35); // Scarlet Monastery + M209 = sConfigMgr->GetIntDefault("Solocraft.TanarisInstance.Level", 44); // Zul'Farrak + M229 = sConfigMgr->GetIntDefault("Solocraft.BlackRockSpire.Level", 55); + M230 = sConfigMgr->GetIntDefault("Solocraft.BlackrockDepths.Level", 50); + M249 = sConfigMgr->GetIntDefault("Solocraft.OnyxiaLairInstance.Level", 60); + M289 = sConfigMgr->GetIntDefault("Solocraft.SchoolofNecromancy.Level", 55); //Scholomance + M309 = sConfigMgr->GetIntDefault("Solocraft.Zul'gurub.Level", 60); + M329 = sConfigMgr->GetIntDefault("Solocraft.Stratholme.Level", 55); + M349 = sConfigMgr->GetIntDefault("Solocraft.Mauradon.Level", 48); + M389 = sConfigMgr->GetIntDefault("Solocraft.OrgrimmarInstance.Level", 15); // Ragefire Chasm + M409 = sConfigMgr->GetIntDefault("Solocraft.MoltenCore.Level", 60); + M429 = sConfigMgr->GetIntDefault("Solocraft.DireMaul.Level", 48); + M469 = sConfigMgr->GetIntDefault("Solocraft.BlackwingLair.Level", 40); + M509 = sConfigMgr->GetIntDefault("Solocraft.AhnQiraj.Level", 60); // Ruins of Ahn'Qiraj + M531 = sConfigMgr->GetIntDefault("Solocraft.AhnQirajTemple.Level", 60); + + // BC Instances + M269 = sConfigMgr->GetIntDefault("Solocraft.CavernsOfTime.Level", 68); // The Black Morass + M532 = sConfigMgr->GetIntDefault("Solocraft.Karazahn.Level", 68); + M534 = sConfigMgr->GetIntDefault("Solocraft.HyjalPast.Level", 70); // The Battle for Mount Hyjal - Hyjal Summit + M540 = sConfigMgr->GetIntDefault("Solocraft.HellfireMilitary.Level", 68); // The Shattered Halls + M542 = sConfigMgr->GetIntDefault("Solocraft.HellfireDemon.Level", 68); // The Blood Furnace + M543 = sConfigMgr->GetIntDefault("Solocraft.HellfireRampart.Level", 68); + M544 = sConfigMgr->GetIntDefault("Solocraft.HellfireRaid.Level", 68); // Magtheridon's Lair + M545 = sConfigMgr->GetIntDefault("Solocraft.CoilfangPumping.Level", 68); // The Steamvault + M546 = sConfigMgr->GetIntDefault("Solocraft.CoilfangMarsh.Level", 68); // The Underbog + M547 = sConfigMgr->GetIntDefault("Solocraft.CoilfangDraenei.Level", 68); // The Slavepens + M548 = sConfigMgr->GetIntDefault("Solocraft.CoilfangRaid.Level", 70); // Serpentshrine Cavern + M550 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepRaid.Level", 70); // The Eye + M552 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepArcane.Level", 68); // The Arcatraz + M553 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepAtrium.Level", 68); // The Botanica + M554 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepFactory.Level", 68); // The Mechanar + M555 = sConfigMgr->GetIntDefault("Solocraft.AuchindounShadow.Level", 68); // Shadow Labyrinth + M556 = sConfigMgr->GetIntDefault("Solocraft.AuchindounDemon.Level", 68); // Sethekk Halls + M557 = sConfigMgr->GetIntDefault("Solocraft.AuchindounEthereal.Level", 68); // Mana-Tombs + M558 = sConfigMgr->GetIntDefault("Solocraft.AuchindounDraenei.Level", 68); // Auchenai Crypts + M560 = sConfigMgr->GetIntDefault("Solocraft.HillsbradPast.Level", 68); // Old Hillsbrad Foothills + M564 = sConfigMgr->GetIntDefault("Solocraft.BlackTemple.Level", 70); + M565 = sConfigMgr->GetIntDefault("Solocraft.GruulsLair.Level", 70); + M568 = sConfigMgr->GetIntDefault("Solocraft.ZulAman.Level", 68); + M580 = sConfigMgr->GetIntDefault("Solocraft.SunwellPlateau.Level", 70); + M585 = sConfigMgr->GetIntDefault("Solocraft.Sunwell5ManFix.Level", 68); // Magister's Terrace + + // WOTLK Instances + M533 = sConfigMgr->GetIntDefault("Solocraft.StratholmeRaid.Level", 78); // Naxxramas + M574 = sConfigMgr->GetIntDefault("Solocraft.Valgarde70.Level", 78); // Utgarde Keep + M575 = sConfigMgr->GetIntDefault("Solocraft.UtgardePinnacle.Level", 78); + M576 = sConfigMgr->GetIntDefault("Solocraft.Nexus70.Level", 78); // The Nexus + M578 = sConfigMgr->GetIntDefault("Solocraft.Nexus80.Level", 78); // The Occulus + M595 = sConfigMgr->GetIntDefault("Solocraft.StratholmeCOT.Level", 78); // The Culling of Stratholme + M599 = sConfigMgr->GetIntDefault("Solocraft.Ulduar70.Level", 78); // Halls of Stone + M600 = sConfigMgr->GetIntDefault("Solocraft.DrakTheronKeep.Level", 78); // Drak'Tharon Keep + M601 = sConfigMgr->GetIntDefault("Solocraft.Azjol_Uppercity.Level", 78); // Azjol-Nerub + M602 = sConfigMgr->GetIntDefault("Solocraft.Ulduar80.Level", 78); // Halls of Lighting + M603 = sConfigMgr->GetIntDefault("Solocraft.UlduarRaid.Level", 80); // Ulduar + M604 = sConfigMgr->GetIntDefault("Solocraft.GunDrak.Level", 78); + M608 = sConfigMgr->GetIntDefault("Solocraft.DalaranPrison.Level", 78); // Violet Hold + M615 = sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsBlack.Level", 80); // The Obsidian Sanctum + M616 = sConfigMgr->GetIntDefault("Solocraft.NexusRaid.Level", 80); // The Eye of Eternity + M619 = sConfigMgr->GetIntDefault("Solocraft.Azjol_LowerCity.Level", 78); // Ahn'kahet: The Old Kingdom + M631 = sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel.Level", 80); //Icecrown Citadel + M632 = sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel5Man.Level", 78); // The Forge of Souls + M649 = sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentRaid.Level", 80); // Trial of the Crusader + M650 = sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentDungeon.Level", 80); //Trial of the Champion + M658 = sConfigMgr->GetIntDefault("Solocraft.QuarryOfTears.Level", 78); // Pit of Saron + M668 = sConfigMgr->GetIntDefault("Solocraft.HallsOfReflection.Level", 78); // Halls of Reflection + M724 = sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsRed.Level", 80); // The Ruby Sanctum + + // Dungeon Difficulty + // Catch alls + D5 = sConfigMgr->GetFloatDefault("Solocraft.Dungeon", 5.0); + D10 = sConfigMgr->GetFloatDefault("Solocraft.Heroic", 10.0); + D25 = sConfigMgr->GetFloatDefault("Solocraft.Raid25", 25.0); + D40 = sConfigMgr->GetFloatDefault("Solocraft.Raid40", 40.0); + + //WOW Classic Instances + D33 = sConfigMgr->GetFloatDefault("Solocraft.ShadowfangKeep", 5.0); + D34 = sConfigMgr->GetFloatDefault("Solocraft.Stockades", 5.0); + D36 = sConfigMgr->GetFloatDefault("Solocraft.Deadmines", 5.0); + D43 = sConfigMgr->GetFloatDefault("Solocraft.WailingCaverns", 5.0); + D47 = sConfigMgr->GetFloatDefault("Solocraft.RazorfenKraulInstance", 5.0); + D48 = sConfigMgr->GetFloatDefault("Solocraft.Blackfathom", 5.0); + D70 = sConfigMgr->GetFloatDefault("Solocraft.Uldaman", 5.0); + D90 = sConfigMgr->GetFloatDefault("Solocraft.GnomeragonInstance", 5.0); + D109 = sConfigMgr->GetFloatDefault("Solocraft.SunkenTemple", 5.0); + D129 = sConfigMgr->GetFloatDefault("Solocraft.RazorfenDowns", 5.0); + D189 = sConfigMgr->GetFloatDefault("Solocraft.MonasteryInstances", 5.0); //Scarlet + D209 = sConfigMgr->GetFloatDefault("Solocraft.TanarisInstance", 5.0); //Zul'Farrak + D229 = sConfigMgr->GetFloatDefault("Solocraft.BlackRockSpire", 10.0); + D230 = sConfigMgr->GetFloatDefault("Solocraft.BlackrockDepths", 5.0); + D249 = sConfigMgr->GetFloatDefault("Solocraft.OnyxiaLairInstance", 40.0); + D289 = sConfigMgr->GetFloatDefault("Solocraft.SchoolofNecromancy", 5.0); //Scholo + D309 = sConfigMgr->GetFloatDefault("Solocraft.Zul'gurub", 20.0); + D329 = sConfigMgr->GetFloatDefault("Solocraft.Stratholme", 5.0); + D349 = sConfigMgr->GetFloatDefault("Solocraft.Mauradon", 5.0); + D389 = sConfigMgr->GetFloatDefault("Solocraft.OrgrimmarInstance", 5.0); //Ragefire + D409 = sConfigMgr->GetFloatDefault("Solocraft.MoltenCore", 40.0); + D429 = sConfigMgr->GetFloatDefault("Solocraft.DireMaul", 5.0); + D469 = sConfigMgr->GetFloatDefault("Solocraft.BlackwingLair", 40.0); + D509 = sConfigMgr->GetFloatDefault("Solocraft.AhnQiraj", 20.0); + D531 = sConfigMgr->GetFloatDefault("Solocraft.AhnQirajTemple", 40.0); + + //BC Instances + D269 = sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTime", 5.0); //Black Morass + D269H = sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTimeH", 5.0); //Black Morass H + D532 = sConfigMgr->GetFloatDefault("Solocraft.Karazahn", 10.0); + D534 = sConfigMgr->GetFloatDefault("Solocraft.HyjalPast", 25.0); //Mount Hyjal + D540 = sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitary", 5.0); //The Shattered Halls + D540H = sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitaryH", 5.0); //The Shattered Halls H + D542 = sConfigMgr->GetFloatDefault("Solocraft.HellfireDemon", 5.0); //The Blood Furnace + D542H = sConfigMgr->GetFloatDefault("Solocraft.HellfireDemonH", 5.0); //The Blood Furnace H + D543 = sConfigMgr->GetFloatDefault("Solocraft.HellfireRampart", 5.0); + D543H = sConfigMgr->GetFloatDefault("Solocraft.HellfireRampartH", 5.0); //Heroic + D544 = sConfigMgr->GetFloatDefault("Solocraft.HellfireRaid", 25.0); //Magtheridon's Lair + D545 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumping", 5.0); //The Steamvault + D545H = sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumpingH", 5.0); //The Steamvault + D546 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarsh", 5.0); //The Underbog + D546H = sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarshH", 5.0); //The Underbog + D547 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraenei", 5.0); //The Slavepens + D547H = sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraeneiH", 5.0); //The Slavepens H + D548 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangRaid", 25.0); //Serpentshrine Cavern + D550 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepRaid", 25.0); //The Eye + D552 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcane", 5.0); //The Arcatraz + D552H = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcaneH", 5.0); //The Arcatraz H + D553 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtrium", 5.0); //The Botanica + D553H = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtriumH", 5.0); //The Botanica H + D554 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactory", 5.0); //The Mechanar + D554H = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactoryH", 5.0); //The Mechanar H + D555 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadow", 5.0); //Shadow Labyrinth + D555H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadowH", 5.0); //Shadow Labyrinth H + D556 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemon", 5.0); //Sethekk Halls + D556H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemonH", 5.0); //Sethekk Halls H + D557 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounEthereal", 5.0); //Mana-Tombs + D557H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounEtherealH", 5.0); //Mana-Tombs H + D558 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraenei", 5.0); //Auchenai Crypts + D558H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraeneiH", 5.0); //Auchenai Crypts H + D560 = sConfigMgr->GetFloatDefault("Solocraft.HillsbradPast", 5.0); //Old Hillsbrad Foothills + D560H = sConfigMgr->GetFloatDefault("Solocraft.HillsbradPastH", 5.0); //Old Hillsbrad Foothills H + D564 = sConfigMgr->GetFloatDefault("Solocraft.BlackTemple", 25.0); + D565 = sConfigMgr->GetFloatDefault("Solocraft.GruulsLair", 25.0); + D568 = sConfigMgr->GetFloatDefault("Solocraft.ZulAman", 5.0); + D568H = sConfigMgr->GetFloatDefault("Solocraft.ZulAmanH", 5.0); //Zul'Aman H + D580 = sConfigMgr->GetFloatDefault("Solocraft.SunwellPlateau", 25.0); + D585 = sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFix", 5.0); //Magister's Terrace + D585H = sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFixH", 5.0); //Magister's Terrace H + + + //WOTLK Instances + D533 = sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaid", 10.0); //Nax 10 + D533H = sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaidH", 25.0); //Nax 25 + D574 = sConfigMgr->GetFloatDefault("Solocraft.Valgarde70", 5.0); //Utgarde Keep + D574H = sConfigMgr->GetFloatDefault("Solocraft.Valgarde70H", 5.0); //Utgarde Keep H + D575 = sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacle", 5.0); + D575H = sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacleH", 5.0); //Utgarde Pinnacle H + D576 = sConfigMgr->GetFloatDefault("Solocraft.Nexus70", 5.0); //The Nexus + D576H = sConfigMgr->GetFloatDefault("Solocraft.Nexus70H", 5.0); //The Nexus H + D578 = sConfigMgr->GetFloatDefault("Solocraft.Nexus80", 5.0); //The Occulus + D578H = sConfigMgr->GetFloatDefault("Solocraft.Nexus80H", 5.0); //The Occulus H + D595 = sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOT", 5.0); //The Culling of Stratholme + D595H = sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOTH", 5.0); //The Culling of Stratholme H + D599 = sConfigMgr->GetFloatDefault("Solocraft.Ulduar70", 5.0); //Halls of Stone + D599H = sConfigMgr->GetFloatDefault("Solocraft.Ulduar70H", 5.0); //Halls of Stone H + D600 = sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeep", 5.0); //Drak'Tharon Keep + D600H = sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeepH", 5.0); //Drak'Tharon Keep H + D601 = sConfigMgr->GetFloatDefault("Solocraft.Azjol_Uppercity", 5.0); //Azjol-Nerub + D601H = sConfigMgr->GetFloatDefault("Solocraft.Azjol_UppercityH", 5.0); //Azjol-Nerub H + D602 = sConfigMgr->GetFloatDefault("Solocraft.Ulduar80", 5.0); //Halls of Lighting + D602H = sConfigMgr->GetFloatDefault("Solocraft.Ulduar80H", 5.0); //Halls of Lighting H + D603 = sConfigMgr->GetFloatDefault("Solocraft.UlduarRaid", 10.0); //Ulduar 10 + D603H = sConfigMgr->GetFloatDefault("Solocraft.UlduarRaidH", 25.0); //Ulduar 25 + D604 = sConfigMgr->GetFloatDefault("Solocraft.GunDrak", 5.0); + D604H = sConfigMgr->GetFloatDefault("Solocraft.GunDrakH", 5.0); //Gundrak H + D608 = sConfigMgr->GetFloatDefault("Solocraft.DalaranPrison", 5.0); //Violet Hold + D608H = sConfigMgr->GetFloatDefault("Solocraft.DalaranPrisonH", 5.0); //Violet Hold H + D615 = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlack", 10.0); //The Obsidian Sanctum 10 + D615H = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlackH", 25.0); //The Obsidian Sanctum 25 + D616 = sConfigMgr->GetFloatDefault("Solocraft.NexusRaid", 10.0); //The Eye of Eternity 10 + D616H = sConfigMgr->GetFloatDefault("Solocraft.NexusRaidH", 25.0); //The Eye of Eternity 25 + D619 = sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCity", 5.0); //Ahn'kahet: The Old Kingdom + D619H = sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCityH", 5.0); //Ahn'kahet: The Old Kingdom H + D631 = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel", 10.0); //Icecrown Citadel 10 + D631H = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadelH", 25.0); //Icecrown Citadel 25 + D632 = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5Man", 5.0); //The Forge of Souls + D632H = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5ManH", 5.0); //The Forge of Souls + D649 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaid", 10.0); //Trial of the Crusader 10 + D649H = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH", 25.0); //Trial of the Crusader 25 + D649H10 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic + D649H25 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic + D650 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeon", 5.0); //Trial of the Champion + D650H = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeonH", 5.0); //Trial of the Champion H + D658 = sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTears", 5.0); //Pit of Saron + D658H = sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTearsH", 5.0); //Pit of Saron H + D668 = sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflection", 5.0); //Halls of Reflection + D668H = sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflectionH", 5.0); //Halls of Reflection H + D724 = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRed", 10.0); //The Ruby Sanctum 10 + D724H = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRedH", 25.0); //The Ruby Sanctum 25 } }; + class SolocraftAnnounce : public PlayerScript { @@ -77,106 +490,723 @@ class solocraft_player_instance_handler : public PlayerScript { if (sConfigMgr->GetBoolDefault("Solocraft.Enable", true)) { Map *map = player->GetMap(); - int difficulty = CalculateDifficulty(map, player); + float difficulty = CalculateDifficulty(map, player); + int dunLevel = CalculateDungeonLevel(map, player); int numInGroup = GetNumInGroup(player); - ApplyBuffs(player, map, difficulty, numInGroup); + ApplyBuffs(player, map, difficulty, dunLevel, numInGroup); } } private: - std::map _unitDifficulty; + std::map _unitDifficulty; -/* - uint32 D5 = 1; - uint32 D10 = 1; - uint32 D25 = 1; - uint32 D40 = 1; -*/ // Set the instance difficulty int CalculateDifficulty(Map* map, Player* /*player*/) { - int difficulty = 1; + float difficulty = 0.0;//changed from 1.0 + int maxLevel = 1; + if (map) { if (map->Is25ManRaid()) { - difficulty = D25; + //WOTLK 25 Man raids + if (map->GetId() == 533) { + difficulty = D533H; //Nax + } + else if (map->GetId() == 603) { + difficulty = D603H; + } + else if (map->GetId() == 615) { + difficulty = D615H; + } + else if (map->GetId() == 616) { + difficulty = D616H; + } + else if (map->GetId() == 631) { + difficulty = D631H; + } + else if (map->GetId() == 724) { + difficulty = D724H; + } + else if (map->IsHeroic() && map->GetId() == 649) { + difficulty = D649H25; //Heroic Grand Trial of the Crusader + } + else if (map->GetId() == 649) { + difficulty = D649H; //25 man Trial of the Crusader + } + else //Catch All --------------- 25 Raids + difficulty = D25; } else if (map->IsHeroic()) { + //BC 5 Man Heroic + if (map->GetId() == 269) { + difficulty = D269H; + } + else if (map->GetId() == 540) { + difficulty = D540H; + } + else if (map->GetId() == 542) { + difficulty = D542H; + } + else if (map->GetId() == 543) { + difficulty = D543H; + } + else if (map->GetId() == 545) { + difficulty = D545H; + } + else if (map->GetId() == 546) { + difficulty = D546H; + } + else if (map->GetId() == 547) { + difficulty = D547H; + } + else if (map->GetId() == 552) { + difficulty = D552H; + } + else if (map->GetId() == 553) { + difficulty = D553H; + } + else if (map->GetId() == 554) { + difficulty = D554H; + } + else if (map->GetId() == 555) { + difficulty = D555H; + } + else if (map->GetId() == 556) { + difficulty = D556H; + } + else if (map->GetId() == 557) { + difficulty = D557H; + } + else if (map->GetId() == 558) { + difficulty = D558H; + } + else if (map->GetId() == 560) { + difficulty = D560H; + } + else if (map->GetId() == 568) { + difficulty = D568H; + } + else if (map->GetId() == 585) { + difficulty = D585H; + } + //WOTLK 5 Man Heroic + else if (map->GetId() == 574) { + difficulty = D574H; + } + else if (map->GetId() == 575) { + difficulty = D575H; + } + else if (map->GetId() == 576) { + difficulty = D576H; + } + else if (map->GetId() == 578) { + difficulty = D578H; + } + else if (map->GetId() == 595) { + difficulty = D595H; + } + else if (map->GetId() == 599) { + difficulty = D599H; + } + else if (map->GetId() == 600) { + difficulty = D600H; + } + else if (map->GetId() == 601) { + difficulty = D601H; + } + else if (map->GetId() == 602) { + difficulty = D602H; + } + else if (map->GetId() == 604) { + difficulty = D604H; + } + else if (map->GetId() == 608) { + difficulty = D608H; + } + else if (map->GetId() == 619) { + difficulty = D619H; + } + else if (map->GetId() == 632) { + difficulty = D632H; + } + else if (map->GetId() == 650) { + difficulty = D650H; + } + else if (map->GetId() == 658) { + difficulty = D658H; + } + else if (map->GetId() == 668) { + difficulty = D668H; + } + //WOTLK 10 Man Heroic + else if (map->GetId() == 649) { + difficulty = D649H10; + } + else //Catch All -----------10 Heroics difficulty = D10; } - else if (map->IsRaid()) { - difficulty = D40; - } + //Wow 10 Man Raid + else if (map->GetId() == 229) { + difficulty = D229; + } + //BC 10 Man Raid + else if (map->GetId() == 532) { + difficulty = D532; + } + //WOTLK 10 Man Raid + else if (map->GetId() == 533) { + difficulty = D533; + } + else if (map->GetId() == 603) { + difficulty = D603; + } + else if (map->GetId() == 615) { + difficulty = D615; + } + else if (map->GetId() == 616) { + difficulty = D616; + } + else if (map->GetId() == 631) { + difficulty = D631; + } + else if (map->GetId() == 649) { + difficulty = D649; + } + else if (map->GetId() == 724) { + difficulty = D724; + } + //Wow 20 Man Raids + else if (map->GetId() == 309) { + difficulty = D309; + } + else if (map->GetId() == 509) { + difficulty = D509; + } + //BC 25 Man Raids + else if (map->GetId() == 534) { + difficulty = D534; + } + else if (map->GetId() == 544) { + difficulty = D544; + } + else if (map->GetId() == 548) { + difficulty = D548; + } + else if (map->GetId() == 550) { + difficulty = D550; + } + else if (map->GetId() == 564) { + difficulty = D564; + } + else if (map->GetId() == 565) { + difficulty = D565; + } + else if (map->GetId() == 580) { + difficulty = D580; + } + //Wow 40 man raids + else if (map->GetId() == 249) { + difficulty = D249; + } + else if (map->GetId() == 409) { + difficulty = D409; + } + else if (map->GetId() == 469) { + difficulty = D469; + } + else if (map->GetId() == 531) { + difficulty = D531; + } + //Wow 5 man dungeons + else if (map->GetId() == 33) { + difficulty = D33; + } + else if (map->GetId() == 34) { + difficulty = D34; + } + else if (map->GetId() == 36) { + difficulty = D36; + } + else if (map->GetId() == 43) { + difficulty = D43; + } + else if (map->GetId() == 47) { + difficulty = D47; + } + else if (map->GetId() == 48) { + difficulty = D48; + } + else if (map->GetId() == 70) { + difficulty = D70; + } + else if (map->GetId() == 90) { + difficulty = D90; + } + else if (map->GetId() == 109) { + difficulty = D109; + } + else if (map->GetId() == 129) { + difficulty = D129; + } + else if (map->GetId() == 189) { + difficulty = D189; + } + else if (map->GetId() == 209) { + difficulty = D209; + } + else if (map->GetId() == 230) { + difficulty = D230; + } + else if (map->GetId() == 289) { + difficulty = D289; + } + else if (map->GetId() == 329) { + difficulty = D329; + } + else if (map->GetId() == 349) { + difficulty = D349; + } + else if (map->GetId() == 389) { + difficulty = D389; + } + else if (map->GetId() == 429) { + difficulty = D429; + } + //BC 5 Man + else if (map->GetId() == 269) { + difficulty = D269; + } + else if (map->GetId() == 540) { + difficulty = D540; + } + else if (map->GetId() == 542) { + difficulty = D542; + } + else if (map->GetId() == 543) { + difficulty = D543; + } + else if (map->GetId() == 545) { + difficulty = D545; + } + else if (map->GetId() == 546) { + difficulty = D546; + } + else if (map->GetId() == 547) { + difficulty = D547; + } + else if (map->GetId() == 552) { + difficulty = D552; + } + else if (map->GetId() == 553) { + difficulty = D553; + } + else if (map->GetId() == 554) { + difficulty = D554; + } + else if (map->GetId() == 555) { + difficulty = D555; + } + else if (map->GetId() == 556) { + difficulty = D556; + } + else if (map->GetId() == 557) { + difficulty = D557; + } + else if (map->GetId() == 558) { + difficulty = D558; + } + else if (map->GetId() == 560) { + difficulty = D560; + } + else if (map->GetId() == 568) { + difficulty = D568; + } + else if (map->GetId() == 585) { + difficulty = D585; + } + //WOTLK 5 Man + else if (map->GetId() == 574) { + difficulty = D574; + } + else if (map->GetId() == 575) { + difficulty = D575; + } + else if (map->GetId() == 576) { + difficulty = D576; + } + else if (map->GetId() == 578) { + difficulty = D578; + } + else if (map->GetId() == 595) { + difficulty = D595; + } + else if (map->GetId() == 599) { + difficulty = D599; + } + else if (map->GetId() == 600) { + difficulty = D600; + } + else if (map->GetId() == 601) { + difficulty = D601; + } + else if (map->GetId() == 602) { + difficulty = D602; + } + else if (map->GetId() == 604) { + difficulty = D604; + } + else if (map->GetId() == 608) { + difficulty = D608; + } + else if (map->GetId() == 619) { + difficulty = D619; + } + else if (map->GetId() == 632) { + difficulty = D632; + } + else if (map->GetId() == 650) { + difficulty = D650; + } + else if (map->GetId() == 658) { + difficulty = D658; + } + else if (map->GetId() == 668) { + difficulty = D668; + } + //Catch Alls ----------------------5 Dungeons and 40 Raids else if (map->IsDungeon()) { difficulty = D5; } + else if (map->IsRaid()) { + difficulty = D40; + } } - return difficulty; + return difficulty; //return the specific dungeon's difficulty offset } - // Get the groups size + + + // Set the Dungeon Level + int CalculateDungeonLevel(Map* map, Player* /*player*/) { + int dunLevel = 1; + switch (map->GetId()) + { + case 33: + dunLevel = M33; break; + case 34: + dunLevel = M34; break; + case 36: + dunLevel = M36; break; + case 43: + dunLevel = M43; break; + case 47: + dunLevel = M47; break; + case 48: + dunLevel = M48; break; + case 70: + dunLevel = M70; break; + case 90: + dunLevel = M90; break; + case 109: + dunLevel = M109; break; + case 129: + dunLevel = M129; break; + case 189: + dunLevel = M189; break; + case 209: + dunLevel = M209; break; + case 229: + dunLevel = M229; break; + case 230: + dunLevel = M230; break; + case 249: + dunLevel = M249; break; + case 289: + dunLevel = M289; break; + case 309: + dunLevel = M309; break; + case 329: + dunLevel = M329; break; + case 349: + dunLevel = M349; break; + case 389: + dunLevel = M389; break; + case 409: + dunLevel = M409; break; + case 429: + dunLevel = M429; break; + case 469: + dunLevel = M469; break; + case 509: + dunLevel = M509; break; + case 531: + dunLevel = M531; break; + case 269: + dunLevel = M269; break; + case 532: + dunLevel = M532; break; + case 534: + dunLevel = M534; break; + case 540: + dunLevel = M540; break; + case 542: + dunLevel = M542; break; + case 543: + dunLevel = M543; break; + case 544: + dunLevel = M544; break; + case 545: + dunLevel = M545; break; + case 546: + dunLevel = M546; break; + case 547: + dunLevel = M547; break; + case 548: + dunLevel = M548; break; + case 550: + dunLevel = M550; break; + case 552: + dunLevel = M552; break; + case 553: + dunLevel = M553; break; + case 554: + dunLevel = M554; break; + case 555: + dunLevel = M555; break; + case 556: + dunLevel = M556; break; + case 557: + dunLevel = M557; break; + case 558: + dunLevel = M558; break; + case 560: + dunLevel = M560; break; + case 564: + dunLevel = M564; break; + case 565: + dunLevel = M565; break; + case 568: + dunLevel = M568; break; + case 580: + dunLevel = M580; break; + case 585: + dunLevel = M585; break; + case 533: + dunLevel = M533; break; + case 574: + dunLevel = M574; break; + case 575: + dunLevel = M575; break; + case 576: + dunLevel = M576; break; + case 578: + dunLevel = M578; break; + case 595: + dunLevel = M595; break; + case 599: + dunLevel = M599; break; + case 600: + dunLevel = M600; break; + case 601: + dunLevel = M601; break; + case 602: + dunLevel = M602; break; + case 603: + dunLevel = M603; break; + case 604: + dunLevel = M604; break; + case 608: + dunLevel = M608; break; + case 615: + dunLevel = M615; break; + case 616: + dunLevel = M616; break; + case 619: + dunLevel = M619; break; + case 631: + dunLevel = M631; break; + case 632: + dunLevel = M632; break; + case 649: + dunLevel = M649; break; + case 650: + dunLevel = M650; break; + case 658: + dunLevel = M658; break; + case 668: + dunLevel = M668; break; + case 724: + dunLevel = M724; break; + default: + dunLevel = SolocraftDungeonLevel; + } + return dunLevel; //return the specific dungeon's level + } + + + // Get the group's size int GetNumInGroup(Player* player) { int numInGroup = 1; Group *group = player->GetGroup(); if (group) { Group::MemberSlotList const& groupMembers = group->GetMemberSlots(); numInGroup = groupMembers.size(); - } + } return numInGroup; } // Apply the player buffs - void ApplyBuffs(Player* player, Map* map, int difficulty, int /*numInGroup*/) + void ApplyBuffs(Player* player, Map* map, float difficulty, int dunLevel, int numInGroup) { - ClearBuffs(player, map); + int SpellPowerBonus = 0; - if (difficulty > 1) - { - // InstanceMap *instanceMap = map->ToInstanceMap(); - // InstanceScript *instanceScript = instanceMap->GetInstanceScript(); + //Check whether to buff the player or check to debuff back to normal + if (difficulty != 0) + { + std::ostringstream ss; + + if (player->getLevel() <= dunLevel + SolocraftLevelDiff) //If a player is too high level for dungeon don't buff but if in a group will count towards the group offset balancing. + { + + //Get Current members total difficulty offset and if it exceeds the difficulty offset of the dungeon then debuff new group members coming in until all members leave and re-enter. This happens when a player already inside dungeon invite others to the group but the player already has the full difficulty offset. + float GroupDifficulty = GetGroupDifficulty(player); + + //Check to either debuff or buff player entering dungeon. Debuff must be enabled in Config + if (GroupDifficulty >= difficulty && SoloCraftDebuffEnable == 1) + { + //Current dungeon offset exceeded - Debuff player + difficulty = (-abs(difficulty)) + (difficulty / numInGroup); + difficulty = roundf(difficulty * 100) / 100; //Float variables suck + + //sLog->outError("%u: would have this difficulty: %f", player->GetGUID(), tempDiff); + + } + else + { + //Current Dungeon offset not exceeded - Buff player + //Group difficulty adjustment + difficulty = difficulty / numInGroup; + difficulty = roundf(difficulty * 100) / 100; //Float variables suck - two decimal rounding + + } - // Announce to player - std::ostringstream ss; - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %d."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty); + //Modify Player Stats + for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h + { + // Buff the player + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * SoloCraftStatsMult, true); //Unitmods enum UNIT_MOD_STAT_START defined in Unit.h line 391 + + } - // Adjust player stats - _unitDifficulty[player->GetGUID()] = difficulty; - for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) - { - // Buff the player - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(difficulty * 100), true); - } + // Set player health + player->SetFullHealth();//defined in Unit.h line 1524 + + //Spellcaster Stat modify + if (player->getPowerType() == POWER_MANA) + { + // Buff the player's mana + player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); + //Buff Spellpower + if (difficulty > 0) //Debuffed characters do not get spellpower + { + SpellPowerBonus = static_cast((player->getLevel() * SoloCraftSpellMult) * difficulty);//Yes, I pulled this calc out of my butt. + player->ApplySpellPowerBonus(SpellPowerBonus,true); + //sLog->outError("%u: spellpower Bonus applied: %i", player->GetGUID(), SpellPowerBonus); + } + } + + //Announcements + if (difficulty > 0) + { + // Announce to player - Buff + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus); + } + else + { + // Announce to player - Debuff + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty); + } + + // Save Player Dungeon Offsets to Database + CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); + } + else + { + // Announce to player - Over Max Level Threshold + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000You have not been buffed. |cffFF8000 Your level is higher than the max level (%i) threshold for this dungeon."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), dunLevel + SolocraftLevelDiff); + } - // Set player health - player->SetFullHealth(); - if (player->getPowerType() == POWER_MANA) - { - // Buff the player's health - player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); - } } + else + ClearBuffs(player, map, numInGroup); //Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues + } + + // Get the current group members GUIDS and return the total sum of the difficulty offset by all group members currently in the dungeon + float GetGroupDifficulty(Player* player) { + float GroupDifficulty = 0.0; + Group *group = player->GetGroup(); + if (group) + { + Group::MemberSlotList const& groupMembers = group->GetMemberSlots(); + for (Group::member_citerator itr = groupMembers.begin(); itr != groupMembers.end(); ++itr) + { + //Exclude player from the tally because the player is the one entering the dungeon + if (itr->guid != player->GetGUID()) + { + //Database query to find difficulty for each group member that is currently in an instance + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = %u", itr->guid); + if (result) + { + //Test for debuffs already give to other members - They cannot be used to determine the total offset because negative numbers will skew the total difficulty offset + if ((*result)[1].GetFloat() > 0) + { + GroupDifficulty = GroupDifficulty + (*result)[1].GetFloat(); + //sLog->outError("%u : Group member GUID in instance: %u", player->GetGUID(), itr->guid); + } + } + } + } + } + return GroupDifficulty; } - - void ClearBuffs(Player* player, Map* map) + + void ClearBuffs(Player* player, Map* map, int numInGroup) { - std::map::iterator unitDifficultyIterator = _unitDifficulty.find(player->GetGUID()); - if (unitDifficultyIterator != _unitDifficulty.end()) - { - int difficulty = unitDifficultyIterator->second; - _unitDifficulty.erase(unitDifficultyIterator); + + //Database query to get offset from the last instance player exited + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID()); + if (result) + { + float difficulty = (*result)[1].GetFloat(); + int SpellPowerBonus = (*result)[3].GetUInt32(); + float StatsMultPct = (*result)[4].GetFloat(); + + //sLog->outError("Map difficulty: %f", difficulty); // Inform the player std::ostringstream ss; - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " exited to %s - Reverting Difficulty Offset: %d."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty); + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " exited to %s - Reverting Difficulty Offset: %0.2f. Spellpower Bonus Removed: %i"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus); // Clear the buffs for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) { - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(difficulty * 100), false); + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * StatsMultPct, false); } - } + if (player->getPowerType() == POWER_MANA && difficulty > 0) + { + // remove spellpower bonus + player->ApplySpellPowerBonus(SpellPowerBonus,false); + //sLog->outError("%u: spellpower Bonus removed: %i", player->GetGUID(), SpellPowerBonus); + } + + //Remove database entry as the player is no longer in an instance + CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID()); + } } }; From a444195cff8984445836b783456dcfba91170e21 Mon Sep 17 00:00:00 2001 From: Lanny Ellis Date: Tue, 26 Jan 2021 12:17:46 -0700 Subject: [PATCH 18/46] Fixed maxlevel unused variable error Removed: unused variable maxlevel at line 508 --- src/Solocraft.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index c95e19d..e439df8 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -505,7 +505,6 @@ class solocraft_player_instance_handler : public PlayerScript { // Set the instance difficulty int CalculateDifficulty(Map* map, Player* /*player*/) { float difficulty = 0.0;//changed from 1.0 - int maxLevel = 1; if (map) { if (map->Is25ManRaid()) { From a853f4955aa372992cf2d6a1ca260588ade96503 Mon Sep 17 00:00:00 2001 From: Lanny Ellis Date: Tue, 26 Jan 2021 13:51:41 -0700 Subject: [PATCH 19/46] Fix Clearbuffs unused variable Removed numInGroup unused variable line 1144 and 1176 --- src/Solocraft.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index e439df8..0735b01 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -1141,7 +1141,7 @@ class solocraft_player_instance_handler : public PlayerScript { } else - ClearBuffs(player, map, numInGroup); //Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues + ClearBuffs(player, map); //Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues } // Get the current group members GUIDS and return the total sum of the difficulty offset by all group members currently in the dungeon @@ -1173,7 +1173,7 @@ class solocraft_player_instance_handler : public PlayerScript { return GroupDifficulty; } - void ClearBuffs(Player* player, Map* map, int numInGroup) + void ClearBuffs(Player* player, Map* map) { //Database query to get offset from the last instance player exited From cda825c3f6c8ef1be9d85302c71ce9cae30b2e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Wed, 27 Jan 2021 00:12:10 +0100 Subject: [PATCH 20/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24381b1..9713b74 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Description -- Adjusts player stats for raids based on the # of players in the group - This now works. +- Adjusts player stats for raids based on the # of players in the group - Configurable debuff for groups trying to overload the difficulty modifier for an instance - Adjustable stats modifier in config - Config: Difficulty settings for each instance and type From 6e676b763e8dda092119644c1a7069f8ab080283 Mon Sep 17 00:00:00 2001 From: Lanny Ellis Date: Thu, 28 Jan 2021 10:24:01 -0700 Subject: [PATCH 21/46] Added Requested Changes Large nested If groups removed and converted into using Hashmaps --- src/Solocraft.cpp | 1170 ++++++++++----------------------------------- 1 file changed, 262 insertions(+), 908 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index d80ae4c..dbe5b58 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -9,6 +9,7 @@ #include "InstanceScript.h" #include "Chat.h" #include +#include bool SoloCraftEnable = 1; bool SoloCraftAnnounceModule = 1; @@ -17,200 +18,17 @@ float SoloCraftSpellMult = 1.0; float SoloCraftStatsMult = 100.0; uint32 SolocraftLevelDiff = 1; uint32 SolocraftDungeonLevel = 1; +std::unordered_map dungeons; +std::unordered_map diff_Multiplier; +std::unordered_map diff_Multiplier_Heroics; float D5 = 1.0; float D10 = 1.0; float D25 = 1.0; float D40 = 1.0; -float D33 = 1.0; -float D34 = 1.0; -float D36 = 1.0; -float D43 = 1.0; -float D47 = 1.0; -float D48 = 1.0; -float D70 = 1.0; -float D90 = 1.0; -float D109 = 1.0; -float D129 = 1.0; -float D189 = 1.0; -float D209 = 1.0; -float D229 = 1.0; -float D230 = 1.0; -float D249 = 1.0; -float D289 = 1.0; -float D309 = 1.0; -float D329 = 1.0; -float D349 = 1.0; -float D389 = 1.0; -float D409 = 1.0; -float D429 = 1.0; -float D469 = 1.0; -float D509 = 1.0; -float D531 = 1.0; -float D269 = 1.0; -float D269H = 1.0; -float D532 = 1.0; -float D534 = 1.0; -float D540 = 1.0; -float D540H = 1.0; -float D542 = 1.0; -float D542H = 1.0; -float D543 = 1.0; -float D543H = 1.0; -float D544 = 1.0; -float D545 = 1.0; -float D545H = 1.0; -float D546 = 1.0; -float D546H = 1.0; -float D547 = 1.0; -float D547H = 1.0; -float D548 = 1.0; -float D550 = 1.0; -float D552 = 1.0; -float D552H = 1.0; -float D553 = 1.0; -float D553H = 1.0; -float D554 = 1.0; -float D554H = 1.0; -float D555 = 1.0; -float D555H = 1.0; -float D556 = 1.0; -float D556H = 1.0; -float D557 = 1.0; -float D557H = 1.0; -float D558 = 1.0; -float D558H = 1.0; -float D560 = 1.0; -float D560H = 1.0; -float D564 = 1.0; -float D565 = 1.0; -float D568 = 1.0; -float D568H = 1.0; -float D580 = 1.0; -float D585 = 1.0; -float D585H = 1.0; -float D533 = 1.0; -float D533H = 1.0; -float D574 = 1.0; -float D574H = 1.0; -float D575 = 1.0; -float D575H = 1.0; -float D576 = 1.0; -float D576H = 1.0; -float D578 = 1.0; -float D578H = 1.0; -float D595 = 1.0; -float D595H = 1.0; -float D599 = 1.0; -float D599H = 1.0; -float D600 = 1.0; -float D600H = 1.0; -float D601 = 1.0; -float D601H = 1.0; -float D602 = 1.0; -float D602H = 1.0; -float D603 = 1.0; -float D603H = 1.0; -float D604 = 1.0; -float D604H = 1.0; -float D608 = 1.0; -float D608H = 1.0; -float D615 = 1.0; -float D615H = 1.0; -float D616 = 1.0; -float D616H = 1.0; -float D619 = 1.0; -float D619H = 1.0; -float D631 = 1.0; -float D631H = 1.0; -float D632 = 1.0; -float D632H = 1.0; -float D649 = 1.0; -float D649H = 1.0; float D649H10 = 1.0; float D649H25 = 1.0; -float D650 = 1.0; -float D650H = 1.0; -float D658 = 1.0; -float D658H = 1.0; -float D668 = 1.0; -float D668H = 1.0; -float D724 = 1.0; -float D724H = 1.0; -uint32 M33 = 1; -uint32 M34 = 1; -uint32 M36 = 1; -uint32 M43 = 1; -uint32 M47 = 1; -uint32 M48 = 1; -uint32 M70 = 1; -uint32 M90 = 1; -uint32 M109 = 1; -uint32 M129 = 1; -uint32 M189 = 1; -uint32 M209 = 1; -uint32 M229 = 1; -uint32 M230 = 1; -uint32 M249 = 1; -uint32 M289 = 1; -uint32 M309 = 1; -uint32 M329 = 1; -uint32 M349 = 1; -uint32 M389 = 1; -uint32 M409 = 1; -uint32 M429 = 1; -uint32 M469 = 1; -uint32 M509 = 1; -uint32 M531 = 1; -uint32 M269 = 1; -uint32 M532 = 1; -uint32 M534 = 1; -uint32 M540 = 1; -uint32 M542 = 1; -uint32 M543 = 1; -uint32 M544 = 1; -uint32 M545 = 1; -uint32 M546 = 1; -uint32 M547 = 1; -uint32 M548 = 1; -uint32 M550 = 1; -uint32 M552 = 1; -uint32 M553 = 1; -uint32 M554 = 1; -uint32 M555 = 1; -uint32 M556 = 1; -uint32 M557 = 1; -uint32 M558 = 1; -uint32 M560 = 1; -uint32 M564 = 1; -uint32 M565 = 1; -uint32 M568 = 1; -uint32 M580 = 1; -uint32 M585 = 1; -uint32 M533 = 1; -uint32 M574 = 1; -uint32 M575 = 1; -uint32 M576 = 1; -uint32 M578 = 1; -uint32 M595 = 1; -uint32 M599 = 1; -uint32 M600 = 1; -uint32 M601 = 1; -uint32 M602 = 1; -uint32 M603 = 1; -uint32 M604 = 1; -uint32 M608 = 1; -uint32 M615 = 1; -uint32 M616 = 1; -uint32 M619 = 1; -uint32 M631 = 1; -uint32 M632 = 1; -uint32 M649 = 1; -uint32 M650 = 1; -uint32 M658 = 1; -uint32 M668 = 1; -uint32 M724 = 1; class SolocraftConfig : public WorldScript { @@ -249,86 +67,89 @@ class SolocraftConfig : public WorldScript //Catch All Dungeon Level Threshold SolocraftDungeonLevel = sConfigMgr->GetIntDefault("Solocraft.Dungeon.Level", 80); - //Dungeon Base Level - //Wow Classic - M33 = sConfigMgr->GetIntDefault("Solocraft.ShadowfangKeep.Level", 15); - M34 = sConfigMgr->GetIntDefault("Solocraft.Stockades.Level", 22); - M36 = sConfigMgr->GetIntDefault("Solocraft.Deadmines.Level", 18); - M43 = sConfigMgr->GetIntDefault("Solocraft.WailingCaverns.Level", 17); - M47 = sConfigMgr->GetIntDefault("Solocraft.RazorfenKraulInstance.Level", 30); - M48 = sConfigMgr->GetIntDefault("Solocraft.Blackfathom.Level", 20); - M70 = sConfigMgr->GetIntDefault("Solocraft.Uldaman.Level", 40); - M90 = sConfigMgr->GetIntDefault("Solocraft.GnomeragonInstance.Level", 24); - M109 = sConfigMgr->GetIntDefault("Solocraft.SunkenTemple.Level", 50); - M129 = sConfigMgr->GetIntDefault("Solocraft.RazorfenDowns.Level", 40); - M189 = sConfigMgr->GetIntDefault("Solocraft.MonasteryInstances.Level", 35); // Scarlet Monastery - M209 = sConfigMgr->GetIntDefault("Solocraft.TanarisInstance.Level", 44); // Zul'Farrak - M229 = sConfigMgr->GetIntDefault("Solocraft.BlackRockSpire.Level", 55); - M230 = sConfigMgr->GetIntDefault("Solocraft.BlackrockDepths.Level", 50); - M249 = sConfigMgr->GetIntDefault("Solocraft.OnyxiaLairInstance.Level", 60); - M289 = sConfigMgr->GetIntDefault("Solocraft.SchoolofNecromancy.Level", 55); //Scholomance - M309 = sConfigMgr->GetIntDefault("Solocraft.Zul'gurub.Level", 60); - M329 = sConfigMgr->GetIntDefault("Solocraft.Stratholme.Level", 55); - M349 = sConfigMgr->GetIntDefault("Solocraft.Mauradon.Level", 48); - M389 = sConfigMgr->GetIntDefault("Solocraft.OrgrimmarInstance.Level", 15); // Ragefire Chasm - M409 = sConfigMgr->GetIntDefault("Solocraft.MoltenCore.Level", 60); - M429 = sConfigMgr->GetIntDefault("Solocraft.DireMaul.Level", 48); - M469 = sConfigMgr->GetIntDefault("Solocraft.BlackwingLair.Level", 40); - M509 = sConfigMgr->GetIntDefault("Solocraft.AhnQiraj.Level", 60); // Ruins of Ahn'Qiraj - M531 = sConfigMgr->GetIntDefault("Solocraft.AhnQirajTemple.Level", 60); + //Dungeon Base Level + dungeons = + { + //Wow Classic + {33, sConfigMgr->GetIntDefault("Solocraft.ShadowfangKeep.Level", 15) }, + {34, sConfigMgr->GetIntDefault("Solocraft.Stockades.Level", 22) }, + {36, sConfigMgr->GetIntDefault("Solocraft.Deadmines.Level", 18) }, + {43, sConfigMgr->GetIntDefault("Solocraft.WailingCaverns.Level", 17) }, + {47, sConfigMgr->GetIntDefault("Solocraft.RazorfenKraulInstance.Level", 30) }, + {48, sConfigMgr->GetIntDefault("Solocraft.Blackfathom.Level", 20) }, + {70, sConfigMgr->GetIntDefault("Solocraft.Uldaman.Level", 40) }, + {90, sConfigMgr->GetIntDefault("Solocraft.GnomeragonInstance.Level", 24) }, + {109, sConfigMgr->GetIntDefault("Solocraft.SunkenTemple.Level", 50) }, + {129, sConfigMgr->GetIntDefault("Solocraft.RazorfenDowns.Level", 40) }, + {189, sConfigMgr->GetIntDefault("Solocraft.MonasteryInstances.Level", 35) }, // Scarlet Monastery + {209, sConfigMgr->GetIntDefault("Solocraft.TanarisInstance.Level", 44) }, // Zul'Farrak + {229, sConfigMgr->GetIntDefault("Solocraft.BlackRockSpire.Level", 55) }, + {230, sConfigMgr->GetIntDefault("Solocraft.BlackrockDepths.Level", 50) }, + {249, sConfigMgr->GetIntDefault("Solocraft.OnyxiaLairInstance.Level", 60) }, + {289, sConfigMgr->GetIntDefault("Solocraft.SchoolofNecromancy.Level", 55) }, //Scholomance + {309, sConfigMgr->GetIntDefault("Solocraft.Zul'gurub.Level", 60) }, + {329, sConfigMgr->GetIntDefault("Solocraft.Stratholme.Level", 55) }, + {349, sConfigMgr->GetIntDefault("Solocraft.Mauradon.Level", 48) }, + {389, sConfigMgr->GetIntDefault("Solocraft.OrgrimmarInstance.Level", 15) }, // Ragefire Chasm + {409, sConfigMgr->GetIntDefault("Solocraft.MoltenCore.Level", 60) }, + {429, sConfigMgr->GetIntDefault("Solocraft.DireMaul.Level", 48) }, + {469, sConfigMgr->GetIntDefault("Solocraft.BlackwingLair.Level", 40) }, + {509, sConfigMgr->GetIntDefault("Solocraft.AhnQiraj.Level", 60) }, // Ruins of Ahn'Qiraj + {531, sConfigMgr->GetIntDefault("Solocraft.AhnQirajTemple.Level", 60) }, - // BC Instances - M269 = sConfigMgr->GetIntDefault("Solocraft.CavernsOfTime.Level", 68); // The Black Morass - M532 = sConfigMgr->GetIntDefault("Solocraft.Karazahn.Level", 68); - M534 = sConfigMgr->GetIntDefault("Solocraft.HyjalPast.Level", 70); // The Battle for Mount Hyjal - Hyjal Summit - M540 = sConfigMgr->GetIntDefault("Solocraft.HellfireMilitary.Level", 68); // The Shattered Halls - M542 = sConfigMgr->GetIntDefault("Solocraft.HellfireDemon.Level", 68); // The Blood Furnace - M543 = sConfigMgr->GetIntDefault("Solocraft.HellfireRampart.Level", 68); - M544 = sConfigMgr->GetIntDefault("Solocraft.HellfireRaid.Level", 68); // Magtheridon's Lair - M545 = sConfigMgr->GetIntDefault("Solocraft.CoilfangPumping.Level", 68); // The Steamvault - M546 = sConfigMgr->GetIntDefault("Solocraft.CoilfangMarsh.Level", 68); // The Underbog - M547 = sConfigMgr->GetIntDefault("Solocraft.CoilfangDraenei.Level", 68); // The Slavepens - M548 = sConfigMgr->GetIntDefault("Solocraft.CoilfangRaid.Level", 70); // Serpentshrine Cavern - M550 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepRaid.Level", 70); // The Eye - M552 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepArcane.Level", 68); // The Arcatraz - M553 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepAtrium.Level", 68); // The Botanica - M554 = sConfigMgr->GetIntDefault("Solocraft.TempestKeepFactory.Level", 68); // The Mechanar - M555 = sConfigMgr->GetIntDefault("Solocraft.AuchindounShadow.Level", 68); // Shadow Labyrinth - M556 = sConfigMgr->GetIntDefault("Solocraft.AuchindounDemon.Level", 68); // Sethekk Halls - M557 = sConfigMgr->GetIntDefault("Solocraft.AuchindounEthereal.Level", 68); // Mana-Tombs - M558 = sConfigMgr->GetIntDefault("Solocraft.AuchindounDraenei.Level", 68); // Auchenai Crypts - M560 = sConfigMgr->GetIntDefault("Solocraft.HillsbradPast.Level", 68); // Old Hillsbrad Foothills - M564 = sConfigMgr->GetIntDefault("Solocraft.BlackTemple.Level", 70); - M565 = sConfigMgr->GetIntDefault("Solocraft.GruulsLair.Level", 70); - M568 = sConfigMgr->GetIntDefault("Solocraft.ZulAman.Level", 68); - M580 = sConfigMgr->GetIntDefault("Solocraft.SunwellPlateau.Level", 70); - M585 = sConfigMgr->GetIntDefault("Solocraft.Sunwell5ManFix.Level", 68); // Magister's Terrace - - // WOTLK Instances - M533 = sConfigMgr->GetIntDefault("Solocraft.StratholmeRaid.Level", 78); // Naxxramas - M574 = sConfigMgr->GetIntDefault("Solocraft.Valgarde70.Level", 78); // Utgarde Keep - M575 = sConfigMgr->GetIntDefault("Solocraft.UtgardePinnacle.Level", 78); - M576 = sConfigMgr->GetIntDefault("Solocraft.Nexus70.Level", 78); // The Nexus - M578 = sConfigMgr->GetIntDefault("Solocraft.Nexus80.Level", 78); // The Occulus - M595 = sConfigMgr->GetIntDefault("Solocraft.StratholmeCOT.Level", 78); // The Culling of Stratholme - M599 = sConfigMgr->GetIntDefault("Solocraft.Ulduar70.Level", 78); // Halls of Stone - M600 = sConfigMgr->GetIntDefault("Solocraft.DrakTheronKeep.Level", 78); // Drak'Tharon Keep - M601 = sConfigMgr->GetIntDefault("Solocraft.Azjol_Uppercity.Level", 78); // Azjol-Nerub - M602 = sConfigMgr->GetIntDefault("Solocraft.Ulduar80.Level", 78); // Halls of Lighting - M603 = sConfigMgr->GetIntDefault("Solocraft.UlduarRaid.Level", 80); // Ulduar - M604 = sConfigMgr->GetIntDefault("Solocraft.GunDrak.Level", 78); - M608 = sConfigMgr->GetIntDefault("Solocraft.DalaranPrison.Level", 78); // Violet Hold - M615 = sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsBlack.Level", 80); // The Obsidian Sanctum - M616 = sConfigMgr->GetIntDefault("Solocraft.NexusRaid.Level", 80); // The Eye of Eternity - M619 = sConfigMgr->GetIntDefault("Solocraft.Azjol_LowerCity.Level", 78); // Ahn'kahet: The Old Kingdom - M631 = sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel.Level", 80); //Icecrown Citadel - M632 = sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel5Man.Level", 78); // The Forge of Souls - M649 = sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentRaid.Level", 80); // Trial of the Crusader - M650 = sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentDungeon.Level", 80); //Trial of the Champion - M658 = sConfigMgr->GetIntDefault("Solocraft.QuarryOfTears.Level", 78); // Pit of Saron - M668 = sConfigMgr->GetIntDefault("Solocraft.HallsOfReflection.Level", 78); // Halls of Reflection - M724 = sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsRed.Level", 80); // The Ruby Sanctum + // BC Instances + {269, sConfigMgr->GetIntDefault("Solocraft.CavernsOfTime.Level", 68) }, // The Black Morass + {532, sConfigMgr->GetIntDefault("Solocraft.Karazahn.Level", 68) }, + {534, sConfigMgr->GetIntDefault("Solocraft.HyjalPast.Level", 70) }, // The Battle for Mount Hyjal - Hyjal Summit + {540, sConfigMgr->GetIntDefault("Solocraft.HellfireMilitary.Level", 68) }, // The Shattered Halls + {542, sConfigMgr->GetIntDefault("Solocraft.HellfireDemon.Level", 68) }, // The Blood Furnace + {543, sConfigMgr->GetIntDefault("Solocraft.HellfireRampart.Level", 68) }, + {544, sConfigMgr->GetIntDefault("Solocraft.HellfireRaid.Level", 68) }, // Magtheridon's Lair + {545, sConfigMgr->GetIntDefault("Solocraft.CoilfangPumping.Level", 68) }, // The Steamvault + {546, sConfigMgr->GetIntDefault("Solocraft.CoilfangMarsh.Level", 68) }, // The Underbog + {547, sConfigMgr->GetIntDefault("Solocraft.CoilfangDraenei.Level", 68) }, // The Slavepens + {548, sConfigMgr->GetIntDefault("Solocraft.CoilfangRaid.Level", 70) }, // Serpentshrine Cavern + {550, sConfigMgr->GetIntDefault("Solocraft.TempestKeepRaid.Level", 70) }, // The Eye + {552, sConfigMgr->GetIntDefault("Solocraft.TempestKeepArcane.Level", 68) }, // The Arcatraz + {553, sConfigMgr->GetIntDefault("Solocraft.TempestKeepAtrium.Level", 68) }, // The Botanica + {554, sConfigMgr->GetIntDefault("Solocraft.TempestKeepFactory.Level", 68) }, // The Mechanar + {555, sConfigMgr->GetIntDefault("Solocraft.AuchindounShadow.Level", 68) }, // Shadow Labyrinth + {556, sConfigMgr->GetIntDefault("Solocraft.AuchindounDemon.Level", 68) }, // Sethekk Halls + {557, sConfigMgr->GetIntDefault("Solocraft.AuchindounEthereal.Level", 68) }, // Mana-Tombs + {558, sConfigMgr->GetIntDefault("Solocraft.AuchindounDraenei.Level", 68) }, // Auchenai Crypts + {560, sConfigMgr->GetIntDefault("Solocraft.HillsbradPast.Level", 68) }, // Old Hillsbrad Foothills + {564, sConfigMgr->GetIntDefault("Solocraft.BlackTemple.Level", 70) }, + {565, sConfigMgr->GetIntDefault("Solocraft.GruulsLair.Level", 70) }, + {568, sConfigMgr->GetIntDefault("Solocraft.ZulAman.Level", 68) }, + {580, sConfigMgr->GetIntDefault("Solocraft.SunwellPlateau.Level", 70) }, + {585, sConfigMgr->GetIntDefault("Solocraft.Sunwell5ManFix.Level", 68) }, // Magister's Terrace + // WOTLK Instances + {533, sConfigMgr->GetIntDefault("Solocraft.StratholmeRaid.Level", 78) }, // Naxxramas + {574, sConfigMgr->GetIntDefault("Solocraft.Valgarde70.Level", 78) }, // Utgarde Keep + {575, sConfigMgr->GetIntDefault("Solocraft.UtgardePinnacle.Level", 78) }, + {576, sConfigMgr->GetIntDefault("Solocraft.Nexus70.Level", 78) }, // The Nexus + {578, sConfigMgr->GetIntDefault("Solocraft.Nexus80.Level", 78) }, // The Occulus + {595, sConfigMgr->GetIntDefault("Solocraft.StratholmeCOT.Level", 78) }, // The Culling of Stratholme + {599, sConfigMgr->GetIntDefault("Solocraft.Ulduar70.Level", 78) }, // Halls of Stone + {600, sConfigMgr->GetIntDefault("Solocraft.DrakTheronKeep.Level", 78) }, // Drak'Tharon Keep + {601, sConfigMgr->GetIntDefault("Solocraft.Azjol_Uppercity.Level", 78) }, // Azjol-Nerub + {602, sConfigMgr->GetIntDefault("Solocraft.Ulduar80.Level", 78) }, // Halls of Lighting + {603, sConfigMgr->GetIntDefault("Solocraft.UlduarRaid.Level", 80) }, // Ulduar + {604, sConfigMgr->GetIntDefault("Solocraft.GunDrak.Level", 78) }, + {608, sConfigMgr->GetIntDefault("Solocraft.DalaranPrison.Level", 78) }, // Violet Hold + {615, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsBlack.Level", 80) }, // The Obsidian Sanctum + {616, sConfigMgr->GetIntDefault("Solocraft.NexusRaid.Level", 80) }, // The Eye of Eternity + {619, sConfigMgr->GetIntDefault("Solocraft.Azjol_LowerCity.Level", 78) }, // Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel.Level", 80) }, //Icecrown Citadel + {632, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel5Man.Level", 78) }, // The Forge of Souls + {649, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentRaid.Level", 80) }, // Trial of the Crusader + {650, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentDungeon.Level", 80) }, //Trial of the Champion + {658, sConfigMgr->GetIntDefault("Solocraft.QuarryOfTears.Level", 78) }, // Pit of Saron + {668, sConfigMgr->GetIntDefault("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection + {724, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum + }; + // Dungeon Difficulty // Catch alls D5 = sConfigMgr->GetFloatDefault("Solocraft.Dungeon", 5.0); @@ -336,127 +157,141 @@ class SolocraftConfig : public WorldScript D25 = sConfigMgr->GetFloatDefault("Solocraft.Raid25", 25.0); D40 = sConfigMgr->GetFloatDefault("Solocraft.Raid40", 40.0); - //WOW Classic Instances - D33 = sConfigMgr->GetFloatDefault("Solocraft.ShadowfangKeep", 5.0); - D34 = sConfigMgr->GetFloatDefault("Solocraft.Stockades", 5.0); - D36 = sConfigMgr->GetFloatDefault("Solocraft.Deadmines", 5.0); - D43 = sConfigMgr->GetFloatDefault("Solocraft.WailingCaverns", 5.0); - D47 = sConfigMgr->GetFloatDefault("Solocraft.RazorfenKraulInstance", 5.0); - D48 = sConfigMgr->GetFloatDefault("Solocraft.Blackfathom", 5.0); - D70 = sConfigMgr->GetFloatDefault("Solocraft.Uldaman", 5.0); - D90 = sConfigMgr->GetFloatDefault("Solocraft.GnomeragonInstance", 5.0); - D109 = sConfigMgr->GetFloatDefault("Solocraft.SunkenTemple", 5.0); - D129 = sConfigMgr->GetFloatDefault("Solocraft.RazorfenDowns", 5.0); - D189 = sConfigMgr->GetFloatDefault("Solocraft.MonasteryInstances", 5.0); //Scarlet - D209 = sConfigMgr->GetFloatDefault("Solocraft.TanarisInstance", 5.0); //Zul'Farrak - D229 = sConfigMgr->GetFloatDefault("Solocraft.BlackRockSpire", 10.0); - D230 = sConfigMgr->GetFloatDefault("Solocraft.BlackrockDepths", 5.0); - D249 = sConfigMgr->GetFloatDefault("Solocraft.OnyxiaLairInstance", 40.0); - D289 = sConfigMgr->GetFloatDefault("Solocraft.SchoolofNecromancy", 5.0); //Scholo - D309 = sConfigMgr->GetFloatDefault("Solocraft.Zul'gurub", 20.0); - D329 = sConfigMgr->GetFloatDefault("Solocraft.Stratholme", 5.0); - D349 = sConfigMgr->GetFloatDefault("Solocraft.Mauradon", 5.0); - D389 = sConfigMgr->GetFloatDefault("Solocraft.OrgrimmarInstance", 5.0); //Ragefire - D409 = sConfigMgr->GetFloatDefault("Solocraft.MoltenCore", 40.0); - D429 = sConfigMgr->GetFloatDefault("Solocraft.DireMaul", 5.0); - D469 = sConfigMgr->GetFloatDefault("Solocraft.BlackwingLair", 40.0); - D509 = sConfigMgr->GetFloatDefault("Solocraft.AhnQiraj", 20.0); - D531 = sConfigMgr->GetFloatDefault("Solocraft.AhnQirajTemple", 40.0); - - //BC Instances - D269 = sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTime", 5.0); //Black Morass - D269H = sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTimeH", 5.0); //Black Morass H - D532 = sConfigMgr->GetFloatDefault("Solocraft.Karazahn", 10.0); - D534 = sConfigMgr->GetFloatDefault("Solocraft.HyjalPast", 25.0); //Mount Hyjal - D540 = sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitary", 5.0); //The Shattered Halls - D540H = sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitaryH", 5.0); //The Shattered Halls H - D542 = sConfigMgr->GetFloatDefault("Solocraft.HellfireDemon", 5.0); //The Blood Furnace - D542H = sConfigMgr->GetFloatDefault("Solocraft.HellfireDemonH", 5.0); //The Blood Furnace H - D543 = sConfigMgr->GetFloatDefault("Solocraft.HellfireRampart", 5.0); - D543H = sConfigMgr->GetFloatDefault("Solocraft.HellfireRampartH", 5.0); //Heroic - D544 = sConfigMgr->GetFloatDefault("Solocraft.HellfireRaid", 25.0); //Magtheridon's Lair - D545 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumping", 5.0); //The Steamvault - D545H = sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumpingH", 5.0); //The Steamvault - D546 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarsh", 5.0); //The Underbog - D546H = sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarshH", 5.0); //The Underbog - D547 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraenei", 5.0); //The Slavepens - D547H = sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraeneiH", 5.0); //The Slavepens H - D548 = sConfigMgr->GetFloatDefault("Solocraft.CoilfangRaid", 25.0); //Serpentshrine Cavern - D550 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepRaid", 25.0); //The Eye - D552 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcane", 5.0); //The Arcatraz - D552H = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcaneH", 5.0); //The Arcatraz H - D553 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtrium", 5.0); //The Botanica - D553H = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtriumH", 5.0); //The Botanica H - D554 = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactory", 5.0); //The Mechanar - D554H = sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactoryH", 5.0); //The Mechanar H - D555 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadow", 5.0); //Shadow Labyrinth - D555H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadowH", 5.0); //Shadow Labyrinth H - D556 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemon", 5.0); //Sethekk Halls - D556H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemonH", 5.0); //Sethekk Halls H - D557 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounEthereal", 5.0); //Mana-Tombs - D557H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounEtherealH", 5.0); //Mana-Tombs H - D558 = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraenei", 5.0); //Auchenai Crypts - D558H = sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraeneiH", 5.0); //Auchenai Crypts H - D560 = sConfigMgr->GetFloatDefault("Solocraft.HillsbradPast", 5.0); //Old Hillsbrad Foothills - D560H = sConfigMgr->GetFloatDefault("Solocraft.HillsbradPastH", 5.0); //Old Hillsbrad Foothills H - D564 = sConfigMgr->GetFloatDefault("Solocraft.BlackTemple", 25.0); - D565 = sConfigMgr->GetFloatDefault("Solocraft.GruulsLair", 25.0); - D568 = sConfigMgr->GetFloatDefault("Solocraft.ZulAman", 5.0); - D568H = sConfigMgr->GetFloatDefault("Solocraft.ZulAmanH", 5.0); //Zul'Aman H - D580 = sConfigMgr->GetFloatDefault("Solocraft.SunwellPlateau", 25.0); - D585 = sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFix", 5.0); //Magister's Terrace - D585H = sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFixH", 5.0); //Magister's Terrace H - - - //WOTLK Instances - D533 = sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaid", 10.0); //Nax 10 - D533H = sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaidH", 25.0); //Nax 25 - D574 = sConfigMgr->GetFloatDefault("Solocraft.Valgarde70", 5.0); //Utgarde Keep - D574H = sConfigMgr->GetFloatDefault("Solocraft.Valgarde70H", 5.0); //Utgarde Keep H - D575 = sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacle", 5.0); - D575H = sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacleH", 5.0); //Utgarde Pinnacle H - D576 = sConfigMgr->GetFloatDefault("Solocraft.Nexus70", 5.0); //The Nexus - D576H = sConfigMgr->GetFloatDefault("Solocraft.Nexus70H", 5.0); //The Nexus H - D578 = sConfigMgr->GetFloatDefault("Solocraft.Nexus80", 5.0); //The Occulus - D578H = sConfigMgr->GetFloatDefault("Solocraft.Nexus80H", 5.0); //The Occulus H - D595 = sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOT", 5.0); //The Culling of Stratholme - D595H = sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOTH", 5.0); //The Culling of Stratholme H - D599 = sConfigMgr->GetFloatDefault("Solocraft.Ulduar70", 5.0); //Halls of Stone - D599H = sConfigMgr->GetFloatDefault("Solocraft.Ulduar70H", 5.0); //Halls of Stone H - D600 = sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeep", 5.0); //Drak'Tharon Keep - D600H = sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeepH", 5.0); //Drak'Tharon Keep H - D601 = sConfigMgr->GetFloatDefault("Solocraft.Azjol_Uppercity", 5.0); //Azjol-Nerub - D601H = sConfigMgr->GetFloatDefault("Solocraft.Azjol_UppercityH", 5.0); //Azjol-Nerub H - D602 = sConfigMgr->GetFloatDefault("Solocraft.Ulduar80", 5.0); //Halls of Lighting - D602H = sConfigMgr->GetFloatDefault("Solocraft.Ulduar80H", 5.0); //Halls of Lighting H - D603 = sConfigMgr->GetFloatDefault("Solocraft.UlduarRaid", 10.0); //Ulduar 10 - D603H = sConfigMgr->GetFloatDefault("Solocraft.UlduarRaidH", 25.0); //Ulduar 25 - D604 = sConfigMgr->GetFloatDefault("Solocraft.GunDrak", 5.0); - D604H = sConfigMgr->GetFloatDefault("Solocraft.GunDrakH", 5.0); //Gundrak H - D608 = sConfigMgr->GetFloatDefault("Solocraft.DalaranPrison", 5.0); //Violet Hold - D608H = sConfigMgr->GetFloatDefault("Solocraft.DalaranPrisonH", 5.0); //Violet Hold H - D615 = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlack", 10.0); //The Obsidian Sanctum 10 - D615H = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlackH", 25.0); //The Obsidian Sanctum 25 - D616 = sConfigMgr->GetFloatDefault("Solocraft.NexusRaid", 10.0); //The Eye of Eternity 10 - D616H = sConfigMgr->GetFloatDefault("Solocraft.NexusRaidH", 25.0); //The Eye of Eternity 25 - D619 = sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCity", 5.0); //Ahn'kahet: The Old Kingdom - D619H = sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCityH", 5.0); //Ahn'kahet: The Old Kingdom H - D631 = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel", 10.0); //Icecrown Citadel 10 - D631H = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadelH", 25.0); //Icecrown Citadel 25 - D632 = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5Man", 5.0); //The Forge of Souls - D632H = sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5ManH", 5.0); //The Forge of Souls - D649 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaid", 10.0); //Trial of the Crusader 10 - D649H = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH", 25.0); //Trial of the Crusader 25 - D649H10 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic - D649H25 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic - D650 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeon", 5.0); //Trial of the Champion - D650H = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeonH", 5.0); //Trial of the Champion H - D658 = sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTears", 5.0); //Pit of Saron - D658H = sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTearsH", 5.0); //Pit of Saron H - D668 = sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflection", 5.0); //Halls of Reflection - D668H = sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflectionH", 5.0); //Halls of Reflection H - D724 = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRed", 10.0); //The Ruby Sanctum 10 - D724H = sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRedH", 25.0); //The Ruby Sanctum 25 + diff_Multiplier = + { + //WOW Classic Instances + {33, sConfigMgr->GetFloatDefault("Solocraft.ShadowfangKeep", 5.0) }, + {34, sConfigMgr->GetFloatDefault("Solocraft.Stockades", 5.0) }, + {36, sConfigMgr->GetFloatDefault("Solocraft.Deadmines", 5.0) }, + {43, sConfigMgr->GetFloatDefault("Solocraft.WailingCaverns", 5.0) }, + {47, sConfigMgr->GetFloatDefault("Solocraft.RazorfenKraulInstance", 5.0) }, + {48, sConfigMgr->GetFloatDefault("Solocraft.Blackfathom", 5.0) }, + {70, sConfigMgr->GetFloatDefault("Solocraft.Uldaman", 5.0) }, + {90, sConfigMgr->GetFloatDefault("Solocraft.GnomeragonInstance", 5.0) }, + {109, sConfigMgr->GetFloatDefault("Solocraft.SunkenTemple", 5.0) }, + {129, sConfigMgr->GetFloatDefault("Solocraft.RazorfenDowns", 5.0) }, + {189, sConfigMgr->GetFloatDefault("Solocraft.MonasteryInstances", 5.0) }, //Scarlet + {209, sConfigMgr->GetFloatDefault("Solocraft.TanarisInstance", 5.0) }, //Zul'Farrak + {229, sConfigMgr->GetFloatDefault("Solocraft.BlackRockSpire", 10.0) }, + {230, sConfigMgr->GetFloatDefault("Solocraft.BlackrockDepths", 5.0) }, + {249, sConfigMgr->GetFloatDefault("Solocraft.OnyxiaLairInstance", 40.0) }, + {289, sConfigMgr->GetFloatDefault("Solocraft.SchoolofNecromancy", 5.0) }, //Scholo + {309, sConfigMgr->GetFloatDefault("Solocraft.Zul'gurub", 20.0) }, + {329, sConfigMgr->GetFloatDefault("Solocraft.Stratholme", 5.0) }, + {349, sConfigMgr->GetFloatDefault("Solocraft.Mauradon", 5.0) }, + {389, sConfigMgr->GetFloatDefault("Solocraft.OrgrimmarInstance", 5.0) }, //Ragefire + {409, sConfigMgr->GetFloatDefault("Solocraft.MoltenCore", 40.0) }, + {429, sConfigMgr->GetFloatDefault("Solocraft.DireMaul", 5.0) }, + {469, sConfigMgr->GetFloatDefault("Solocraft.BlackwingLair", 40.0) }, + {509, sConfigMgr->GetFloatDefault("Solocraft.AhnQiraj", 20.0) }, + {531, sConfigMgr->GetFloatDefault("Solocraft.AhnQirajTemple", 40.0) }, + + //BC Instances + {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTime", 5.0) }, //Black Morass + {532, sConfigMgr->GetFloatDefault("Solocraft.Karazahn", 10.0) }, + {534, sConfigMgr->GetFloatDefault("Solocraft.HyjalPast", 25.0) }, //Mount Hyjal + {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitary", 5.0) }, //The Shattered Halls + {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemon", 5.0) }, //The Blood Furnace + {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampart", 5.0) }, + {544, sConfigMgr->GetFloatDefault("Solocraft.HellfireRaid", 25.0) }, //Magtheridon's Lair + {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumping", 5.0) }, //The Steamvault + {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarsh", 5.0) }, //The Underbog + {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraenei", 5.0) }, //The Slavepens + {548, sConfigMgr->GetFloatDefault("Solocraft.CoilfangRaid", 25.0) }, //Serpentshrine Cavern + {550, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepRaid", 25.0) }, //The Eye + {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcane", 5.0) }, //The Arcatraz + {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtrium", 5.0) }, //The Botanica + {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactory", 5.0) }, //The Mechanar + {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadow", 5.0) }, //Shadow Labyrinth + {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemon", 5.0) }, //Sethekk Halls + {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEthereal", 5.0) }, //Mana-Tombs + {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraenei", 5.0) }, //Auchenai Crypts + {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPast", 5.0) }, //Old Hillsbrad Foothills + {564, sConfigMgr->GetFloatDefault("Solocraft.BlackTemple", 25.0) }, + {565, sConfigMgr->GetFloatDefault("Solocraft.GruulsLair", 25.0) }, + {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAman", 5.0) }, + {580, sConfigMgr->GetFloatDefault("Solocraft.SunwellPlateau", 25.0) }, + {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFix", 5.0) }, //Magister's Terrace + + //WOTLK Instances + {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaid", 10.0) }, //Nax 10 + {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70", 5.0) }, //Utgarde Keep + {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacle", 5.0) }, + {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70", 5.0) }, //The Nexus + {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80", 5.0) }, //The Occulus + {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOT", 5.0) }, //The Culling of Stratholme + {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70", 5.0) }, //Halls of Stone + {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeep", 5.0) }, //Drak'Tharon Keep + {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_Uppercity", 5.0) }, //Azjol-Nerub + {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80", 5.0) }, //Halls of Lighting + {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaid", 10.0) }, //Ulduar 10 + {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrak", 5.0) }, + {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrison", 5.0) }, //Violet Hold + {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlack", 10.0) }, //The Obsidian Sanctum 10 + {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaid", 10.0) }, //The Eye of Eternity 10 + {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCity", 5.0) }, //Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel", 10.0) }, //Icecrown Citadel 10 + {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5Man", 5.0) }, //The Forge of Souls + {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaid", 10.0) }, //Trial of the Crusader 10 + {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeon", 5.0) }, //Trial of the Champion + {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTears", 5.0) }, //Pit of Saron + {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflection", 5.0) }, //Halls of Reflection + {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRed", 10.0) }, //The Ruby Sanctum 10 + }; + + + //Heroics + diff_Multiplier_Heroics = + { + //BC Instances Heroics + {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTimeH", 5.0) }, //Black Morass H + {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitaryH", 5.0) }, //The Shattered Halls H + {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemonH", 5.0) }, //The Blood Furnace H + {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampartH", 5.0) }, //Heroic + {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumpingH", 5.0) }, //The Steamvault + {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarshH", 5.0) }, //The Underbog + {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraeneiH", 5.0) }, //The Slavepens H + {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcaneH", 5.0) }, //The Arcatraz H + {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtriumH", 5.0) }, //The Botanica H + {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactoryH", 5.0) }, //The Mechanar H + {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadowH", 5.0) }, //Shadow Labyrinth H + {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemonH", 5.0) }, //Sethekk Halls H + {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEtherealH", 5.0) }, //Mana-Tombs H + {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraeneiH", 5.0) }, //Auchenai Crypts H + {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPastH", 5.0) }, //Old Hillsbrad Foothills H + {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAmanH", 5.0) }, //Zul'Aman H + {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFixH", 5.0) }, //Magister's Terrace H + + //WOTLK Instances Heroics + {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaidH", 25.0) }, //Nax 25 + {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70H", 5.0) }, //Utgarde Keep H + {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacleH", 5.0) }, //Utgarde Pinnacle H + {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70H", 5.0) }, //The Nexus H + {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80H", 5.0) }, //The Occulus H + {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOTH", 5.0) }, //The Culling of Stratholme H + {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70H", 5.0) }, //Halls of Stone H + {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeepH", 5.0) }, //Drak'Tharon Keep H + {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_UppercityH", 5.0) }, //Azjol-Nerub H + {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80H", 5.0) }, //Halls of Lighting H + {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaidH", 25.0) }, //Ulduar 25 + {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrakH", 5.0) }, //Gundrak H + {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrisonH", 5.0) }, //Violet Hold H + {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlackH", 25.0) }, //The Obsidian Sanctum 25 + {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaidH", 25.0) }, //The Eye of Eternity 25 + {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCityH", 5.0) }, //Ahn'kahet: The Old Kingdom H + {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadelH", 25.0) }, //Icecrown Citadel 25 + {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5ManH", 5.0) }, //The Forge of Souls + {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH", 25.0) }, //Trial of the Crusader 25 + {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeonH", 5.0) }, //Trial of the Champion H + {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTearsH", 5.0) }, //Pit of Saron H + {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflectionH", 5.0) }, //Halls of Reflection H + {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRedH", 25.0) }, //The Ruby Sanctum 25 + }; + + //Unique Raids beyond the heroic and normal versions of themselves + D649H10 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic + D649H25 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic + } }; @@ -504,543 +339,62 @@ class solocraft_player_instance_handler : public PlayerScript { // Set the instance difficulty int CalculateDifficulty(Map* map, Player* /*player*/) { - float difficulty = 0.0;//changed from 1.0 - + //float difficulty = 0.0;//changed from 1.0 + if (map) { - if (map->Is25ManRaid()) { - //WOTLK 25 Man raids - if (map->GetId() == 533) { - difficulty = D533H; //Nax - } - else if (map->GetId() == 603) { - difficulty = D603H; + //WOTLK 25 Man raids + if (map->Is25ManRaid()) + { + if (map->IsHeroic() && map->GetId() == 649) { + return D649H25; //Heroic Grand Trial of the Crusader } - else if (map->GetId() == 615) { - difficulty = D615H; + else if(diff_Multiplier_Heroics.find(map->GetId()) == diff_Multiplier_Heroics.end()){ + return D25; //map not found returns the catch all value } - else if (map->GetId() == 616) { - difficulty = D616H; + else + return diff_Multiplier_Heroics[map->GetId()]; //return the specific dungeon's level + } + + + if (map->IsHeroic()) + { + //WOTLK 10 Man Heroic + if (map->GetId() == 649) { + return D649H10; } - else if (map->GetId() == 631) { - difficulty = D631H; + else if(diff_Multiplier_Heroics.find(map->GetId()) == diff_Multiplier_Heroics.end()){ + return D10; //map not found returns the catch all value } - else if (map->GetId() == 724) { - difficulty = D724H; - } - else if (map->IsHeroic() && map->GetId() == 649) { - difficulty = D649H25; //Heroic Grand Trial of the Crusader + else + return diff_Multiplier_Heroics[map->GetId()]; //return the specific dungeon's level + } + + + if (diff_Multiplier.find(map->GetId()) == diff_Multiplier.end()) { + //Catch Alls ----------------------5 Dungeons and 40 Raids + if (map->IsDungeon()) { + return D5; } - else if (map->GetId() == 649) { - difficulty = D649H; //25 man Trial of the Crusader + else if (map->IsRaid()) { + return D40; } - else //Catch All --------------- 25 Raids - difficulty = D25; - } - else if (map->IsHeroic()) { - //BC 5 Man Heroic - if (map->GetId() == 269) { - difficulty = D269H; - } - else if (map->GetId() == 540) { - difficulty = D540H; - } - else if (map->GetId() == 542) { - difficulty = D542H; - } - else if (map->GetId() == 543) { - difficulty = D543H; - } - else if (map->GetId() == 545) { - difficulty = D545H; - } - else if (map->GetId() == 546) { - difficulty = D546H; - } - else if (map->GetId() == 547) { - difficulty = D547H; - } - else if (map->GetId() == 552) { - difficulty = D552H; - } - else if (map->GetId() == 553) { - difficulty = D553H; - } - else if (map->GetId() == 554) { - difficulty = D554H; - } - else if (map->GetId() == 555) { - difficulty = D555H; - } - else if (map->GetId() == 556) { - difficulty = D556H; - } - else if (map->GetId() == 557) { - difficulty = D557H; - } - else if (map->GetId() == 558) { - difficulty = D558H; - } - else if (map->GetId() == 560) { - difficulty = D560H; - } - else if (map->GetId() == 568) { - difficulty = D568H; - } - else if (map->GetId() == 585) { - difficulty = D585H; - } - //WOTLK 5 Man Heroic - else if (map->GetId() == 574) { - difficulty = D574H; - } - else if (map->GetId() == 575) { - difficulty = D575H; - } - else if (map->GetId() == 576) { - difficulty = D576H; - } - else if (map->GetId() == 578) { - difficulty = D578H; - } - else if (map->GetId() == 595) { - difficulty = D595H; - } - else if (map->GetId() == 599) { - difficulty = D599H; - } - else if (map->GetId() == 600) { - difficulty = D600H; - } - else if (map->GetId() == 601) { - difficulty = D601H; - } - else if (map->GetId() == 602) { - difficulty = D602H; - } - else if (map->GetId() == 604) { - difficulty = D604H; - } - else if (map->GetId() == 608) { - difficulty = D608H; - } - else if (map->GetId() == 619) { - difficulty = D619H; - } - else if (map->GetId() == 632) { - difficulty = D632H; - } - else if (map->GetId() == 650) { - difficulty = D650H; - } - else if (map->GetId() == 658) { - difficulty = D658H; - } - else if (map->GetId() == 668) { - difficulty = D668H; - } - //WOTLK 10 Man Heroic - else if (map->GetId() == 649) { - difficulty = D649H10; - } - else //Catch All -----------10 Heroics - difficulty = D10; - } - //Wow 10 Man Raid - else if (map->GetId() == 229) { - difficulty = D229; - } - //BC 10 Man Raid - else if (map->GetId() == 532) { - difficulty = D532; - } - //WOTLK 10 Man Raid - else if (map->GetId() == 533) { - difficulty = D533; - } - else if (map->GetId() == 603) { - difficulty = D603; - } - else if (map->GetId() == 615) { - difficulty = D615; - } - else if (map->GetId() == 616) { - difficulty = D616; - } - else if (map->GetId() == 631) { - difficulty = D631; - } - else if (map->GetId() == 649) { - difficulty = D649; - } - else if (map->GetId() == 724) { - difficulty = D724; - } - //Wow 20 Man Raids - else if (map->GetId() == 309) { - difficulty = D309; - } - else if (map->GetId() == 509) { - difficulty = D509; - } - //BC 25 Man Raids - else if (map->GetId() == 534) { - difficulty = D534; - } - else if (map->GetId() == 544) { - difficulty = D544; - } - else if (map->GetId() == 548) { - difficulty = D548; - } - else if (map->GetId() == 550) { - difficulty = D550; - } - else if (map->GetId() == 564) { - difficulty = D564; - } - else if (map->GetId() == 565) { - difficulty = D565; - } - else if (map->GetId() == 580) { - difficulty = D580; - } - //Wow 40 man raids - else if (map->GetId() == 249) { - difficulty = D249; - } - else if (map->GetId() == 409) { - difficulty = D409; - } - else if (map->GetId() == 469) { - difficulty = D469; - } - else if (map->GetId() == 531) { - difficulty = D531; - } - //Wow 5 man dungeons - else if (map->GetId() == 33) { - difficulty = D33; - } - else if (map->GetId() == 34) { - difficulty = D34; } - else if (map->GetId() == 36) { - difficulty = D36; - } - else if (map->GetId() == 43) { - difficulty = D43; - } - else if (map->GetId() == 47) { - difficulty = D47; - } - else if (map->GetId() == 48) { - difficulty = D48; - } - else if (map->GetId() == 70) { - difficulty = D70; - } - else if (map->GetId() == 90) { - difficulty = D90; - } - else if (map->GetId() == 109) { - difficulty = D109; - } - else if (map->GetId() == 129) { - difficulty = D129; - } - else if (map->GetId() == 189) { - difficulty = D189; - } - else if (map->GetId() == 209) { - difficulty = D209; - } - else if (map->GetId() == 230) { - difficulty = D230; - } - else if (map->GetId() == 289) { - difficulty = D289; - } - else if (map->GetId() == 329) { - difficulty = D329; - } - else if (map->GetId() == 349) { - difficulty = D349; - } - else if (map->GetId() == 389) { - difficulty = D389; - } - else if (map->GetId() == 429) { - difficulty = D429; - } - //BC 5 Man - else if (map->GetId() == 269) { - difficulty = D269; - } - else if (map->GetId() == 540) { - difficulty = D540; - } - else if (map->GetId() == 542) { - difficulty = D542; - } - else if (map->GetId() == 543) { - difficulty = D543; - } - else if (map->GetId() == 545) { - difficulty = D545; - } - else if (map->GetId() == 546) { - difficulty = D546; - } - else if (map->GetId() == 547) { - difficulty = D547; - } - else if (map->GetId() == 552) { - difficulty = D552; - } - else if (map->GetId() == 553) { - difficulty = D553; - } - else if (map->GetId() == 554) { - difficulty = D554; - } - else if (map->GetId() == 555) { - difficulty = D555; - } - else if (map->GetId() == 556) { - difficulty = D556; - } - else if (map->GetId() == 557) { - difficulty = D557; - } - else if (map->GetId() == 558) { - difficulty = D558; - } - else if (map->GetId() == 560) { - difficulty = D560; - } - else if (map->GetId() == 568) { - difficulty = D568; - } - else if (map->GetId() == 585) { - difficulty = D585; - } - //WOTLK 5 Man - else if (map->GetId() == 574) { - difficulty = D574; - } - else if (map->GetId() == 575) { - difficulty = D575; - } - else if (map->GetId() == 576) { - difficulty = D576; - } - else if (map->GetId() == 578) { - difficulty = D578; - } - else if (map->GetId() == 595) { - difficulty = D595; - } - else if (map->GetId() == 599) { - difficulty = D599; - } - else if (map->GetId() == 600) { - difficulty = D600; - } - else if (map->GetId() == 601) { - difficulty = D601; - } - else if (map->GetId() == 602) { - difficulty = D602; - } - else if (map->GetId() == 604) { - difficulty = D604; - } - else if (map->GetId() == 608) { - difficulty = D608; - } - else if (map->GetId() == 619) { - difficulty = D619; - } - else if (map->GetId() == 632) { - difficulty = D632; - } - else if (map->GetId() == 650) { - difficulty = D650; - } - else if (map->GetId() == 658) { - difficulty = D658; - } - else if (map->GetId() == 668) { - difficulty = D668; - } - //Catch Alls ----------------------5 Dungeons and 40 Raids - else if (map->IsDungeon()) { - difficulty = D5; - } - else if (map->IsRaid()) { - difficulty = D40; - } - } - return difficulty; //return the specific dungeon's difficulty offset + else + return diff_Multiplier[map->GetId()]; //return the specific dungeon's level + } + return 0; //return 0 } // Set the Dungeon Level int CalculateDungeonLevel(Map* map, Player* /*player*/) { - int dunLevel = 1; - switch (map->GetId()) - { - case 33: - dunLevel = M33; break; - case 34: - dunLevel = M34; break; - case 36: - dunLevel = M36; break; - case 43: - dunLevel = M43; break; - case 47: - dunLevel = M47; break; - case 48: - dunLevel = M48; break; - case 70: - dunLevel = M70; break; - case 90: - dunLevel = M90; break; - case 109: - dunLevel = M109; break; - case 129: - dunLevel = M129; break; - case 189: - dunLevel = M189; break; - case 209: - dunLevel = M209; break; - case 229: - dunLevel = M229; break; - case 230: - dunLevel = M230; break; - case 249: - dunLevel = M249; break; - case 289: - dunLevel = M289; break; - case 309: - dunLevel = M309; break; - case 329: - dunLevel = M329; break; - case 349: - dunLevel = M349; break; - case 389: - dunLevel = M389; break; - case 409: - dunLevel = M409; break; - case 429: - dunLevel = M429; break; - case 469: - dunLevel = M469; break; - case 509: - dunLevel = M509; break; - case 531: - dunLevel = M531; break; - case 269: - dunLevel = M269; break; - case 532: - dunLevel = M532; break; - case 534: - dunLevel = M534; break; - case 540: - dunLevel = M540; break; - case 542: - dunLevel = M542; break; - case 543: - dunLevel = M543; break; - case 544: - dunLevel = M544; break; - case 545: - dunLevel = M545; break; - case 546: - dunLevel = M546; break; - case 547: - dunLevel = M547; break; - case 548: - dunLevel = M548; break; - case 550: - dunLevel = M550; break; - case 552: - dunLevel = M552; break; - case 553: - dunLevel = M553; break; - case 554: - dunLevel = M554; break; - case 555: - dunLevel = M555; break; - case 556: - dunLevel = M556; break; - case 557: - dunLevel = M557; break; - case 558: - dunLevel = M558; break; - case 560: - dunLevel = M560; break; - case 564: - dunLevel = M564; break; - case 565: - dunLevel = M565; break; - case 568: - dunLevel = M568; break; - case 580: - dunLevel = M580; break; - case 585: - dunLevel = M585; break; - case 533: - dunLevel = M533; break; - case 574: - dunLevel = M574; break; - case 575: - dunLevel = M575; break; - case 576: - dunLevel = M576; break; - case 578: - dunLevel = M578; break; - case 595: - dunLevel = M595; break; - case 599: - dunLevel = M599; break; - case 600: - dunLevel = M600; break; - case 601: - dunLevel = M601; break; - case 602: - dunLevel = M602; break; - case 603: - dunLevel = M603; break; - case 604: - dunLevel = M604; break; - case 608: - dunLevel = M608; break; - case 615: - dunLevel = M615; break; - case 616: - dunLevel = M616; break; - case 619: - dunLevel = M619; break; - case 631: - dunLevel = M631; break; - case 632: - dunLevel = M632; break; - case 649: - dunLevel = M649; break; - case 650: - dunLevel = M650; break; - case 658: - dunLevel = M658; break; - case 668: - dunLevel = M668; break; - case 724: - dunLevel = M724; break; - default: - dunLevel = SolocraftDungeonLevel; + if (dungeons.find(map->GetId()) == dungeons.end()) + { + return SolocraftDungeonLevel; //map not found returns the catch all value } - return dunLevel; //return the specific dungeon's level + else + return dungeons[map->GetId()]; //return the specific dungeon's level } @@ -1214,4 +568,4 @@ void AddSolocraftScripts() new SolocraftConfig(); new SolocraftAnnounce(); new solocraft_player_instance_handler(); -} +} \ No newline at end of file From cee5ff7373883218e7b11814afe72639f5827e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Thu, 28 Jan 2021 19:10:44 +0100 Subject: [PATCH 22/46] chore(style): improve comments --- src/Solocraft.cpp | 436 +++++++++++++++++++++++----------------------- 1 file changed, 219 insertions(+), 217 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index dbe5b58..85276a0 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -67,226 +67,228 @@ class SolocraftConfig : public WorldScript //Catch All Dungeon Level Threshold SolocraftDungeonLevel = sConfigMgr->GetIntDefault("Solocraft.Dungeon.Level", 80); - //Dungeon Base Level - dungeons = - { - //Wow Classic - {33, sConfigMgr->GetIntDefault("Solocraft.ShadowfangKeep.Level", 15) }, - {34, sConfigMgr->GetIntDefault("Solocraft.Stockades.Level", 22) }, - {36, sConfigMgr->GetIntDefault("Solocraft.Deadmines.Level", 18) }, - {43, sConfigMgr->GetIntDefault("Solocraft.WailingCaverns.Level", 17) }, - {47, sConfigMgr->GetIntDefault("Solocraft.RazorfenKraulInstance.Level", 30) }, - {48, sConfigMgr->GetIntDefault("Solocraft.Blackfathom.Level", 20) }, - {70, sConfigMgr->GetIntDefault("Solocraft.Uldaman.Level", 40) }, - {90, sConfigMgr->GetIntDefault("Solocraft.GnomeragonInstance.Level", 24) }, - {109, sConfigMgr->GetIntDefault("Solocraft.SunkenTemple.Level", 50) }, - {129, sConfigMgr->GetIntDefault("Solocraft.RazorfenDowns.Level", 40) }, - {189, sConfigMgr->GetIntDefault("Solocraft.MonasteryInstances.Level", 35) }, // Scarlet Monastery - {209, sConfigMgr->GetIntDefault("Solocraft.TanarisInstance.Level", 44) }, // Zul'Farrak - {229, sConfigMgr->GetIntDefault("Solocraft.BlackRockSpire.Level", 55) }, - {230, sConfigMgr->GetIntDefault("Solocraft.BlackrockDepths.Level", 50) }, - {249, sConfigMgr->GetIntDefault("Solocraft.OnyxiaLairInstance.Level", 60) }, - {289, sConfigMgr->GetIntDefault("Solocraft.SchoolofNecromancy.Level", 55) }, //Scholomance - {309, sConfigMgr->GetIntDefault("Solocraft.Zul'gurub.Level", 60) }, - {329, sConfigMgr->GetIntDefault("Solocraft.Stratholme.Level", 55) }, - {349, sConfigMgr->GetIntDefault("Solocraft.Mauradon.Level", 48) }, - {389, sConfigMgr->GetIntDefault("Solocraft.OrgrimmarInstance.Level", 15) }, // Ragefire Chasm - {409, sConfigMgr->GetIntDefault("Solocraft.MoltenCore.Level", 60) }, - {429, sConfigMgr->GetIntDefault("Solocraft.DireMaul.Level", 48) }, - {469, sConfigMgr->GetIntDefault("Solocraft.BlackwingLair.Level", 40) }, - {509, sConfigMgr->GetIntDefault("Solocraft.AhnQiraj.Level", 60) }, // Ruins of Ahn'Qiraj - {531, sConfigMgr->GetIntDefault("Solocraft.AhnQirajTemple.Level", 60) }, - - // BC Instances - {269, sConfigMgr->GetIntDefault("Solocraft.CavernsOfTime.Level", 68) }, // The Black Morass - {532, sConfigMgr->GetIntDefault("Solocraft.Karazahn.Level", 68) }, - {534, sConfigMgr->GetIntDefault("Solocraft.HyjalPast.Level", 70) }, // The Battle for Mount Hyjal - Hyjal Summit - {540, sConfigMgr->GetIntDefault("Solocraft.HellfireMilitary.Level", 68) }, // The Shattered Halls - {542, sConfigMgr->GetIntDefault("Solocraft.HellfireDemon.Level", 68) }, // The Blood Furnace - {543, sConfigMgr->GetIntDefault("Solocraft.HellfireRampart.Level", 68) }, - {544, sConfigMgr->GetIntDefault("Solocraft.HellfireRaid.Level", 68) }, // Magtheridon's Lair - {545, sConfigMgr->GetIntDefault("Solocraft.CoilfangPumping.Level", 68) }, // The Steamvault - {546, sConfigMgr->GetIntDefault("Solocraft.CoilfangMarsh.Level", 68) }, // The Underbog - {547, sConfigMgr->GetIntDefault("Solocraft.CoilfangDraenei.Level", 68) }, // The Slavepens - {548, sConfigMgr->GetIntDefault("Solocraft.CoilfangRaid.Level", 70) }, // Serpentshrine Cavern - {550, sConfigMgr->GetIntDefault("Solocraft.TempestKeepRaid.Level", 70) }, // The Eye - {552, sConfigMgr->GetIntDefault("Solocraft.TempestKeepArcane.Level", 68) }, // The Arcatraz - {553, sConfigMgr->GetIntDefault("Solocraft.TempestKeepAtrium.Level", 68) }, // The Botanica - {554, sConfigMgr->GetIntDefault("Solocraft.TempestKeepFactory.Level", 68) }, // The Mechanar - {555, sConfigMgr->GetIntDefault("Solocraft.AuchindounShadow.Level", 68) }, // Shadow Labyrinth - {556, sConfigMgr->GetIntDefault("Solocraft.AuchindounDemon.Level", 68) }, // Sethekk Halls - {557, sConfigMgr->GetIntDefault("Solocraft.AuchindounEthereal.Level", 68) }, // Mana-Tombs - {558, sConfigMgr->GetIntDefault("Solocraft.AuchindounDraenei.Level", 68) }, // Auchenai Crypts - {560, sConfigMgr->GetIntDefault("Solocraft.HillsbradPast.Level", 68) }, // Old Hillsbrad Foothills - {564, sConfigMgr->GetIntDefault("Solocraft.BlackTemple.Level", 70) }, - {565, sConfigMgr->GetIntDefault("Solocraft.GruulsLair.Level", 70) }, - {568, sConfigMgr->GetIntDefault("Solocraft.ZulAman.Level", 68) }, - {580, sConfigMgr->GetIntDefault("Solocraft.SunwellPlateau.Level", 70) }, - {585, sConfigMgr->GetIntDefault("Solocraft.Sunwell5ManFix.Level", 68) }, // Magister's Terrace - - // WOTLK Instances - {533, sConfigMgr->GetIntDefault("Solocraft.StratholmeRaid.Level", 78) }, // Naxxramas - {574, sConfigMgr->GetIntDefault("Solocraft.Valgarde70.Level", 78) }, // Utgarde Keep - {575, sConfigMgr->GetIntDefault("Solocraft.UtgardePinnacle.Level", 78) }, - {576, sConfigMgr->GetIntDefault("Solocraft.Nexus70.Level", 78) }, // The Nexus - {578, sConfigMgr->GetIntDefault("Solocraft.Nexus80.Level", 78) }, // The Occulus - {595, sConfigMgr->GetIntDefault("Solocraft.StratholmeCOT.Level", 78) }, // The Culling of Stratholme - {599, sConfigMgr->GetIntDefault("Solocraft.Ulduar70.Level", 78) }, // Halls of Stone - {600, sConfigMgr->GetIntDefault("Solocraft.DrakTheronKeep.Level", 78) }, // Drak'Tharon Keep - {601, sConfigMgr->GetIntDefault("Solocraft.Azjol_Uppercity.Level", 78) }, // Azjol-Nerub - {602, sConfigMgr->GetIntDefault("Solocraft.Ulduar80.Level", 78) }, // Halls of Lighting - {603, sConfigMgr->GetIntDefault("Solocraft.UlduarRaid.Level", 80) }, // Ulduar - {604, sConfigMgr->GetIntDefault("Solocraft.GunDrak.Level", 78) }, - {608, sConfigMgr->GetIntDefault("Solocraft.DalaranPrison.Level", 78) }, // Violet Hold - {615, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsBlack.Level", 80) }, // The Obsidian Sanctum - {616, sConfigMgr->GetIntDefault("Solocraft.NexusRaid.Level", 80) }, // The Eye of Eternity - {619, sConfigMgr->GetIntDefault("Solocraft.Azjol_LowerCity.Level", 78) }, // Ahn'kahet: The Old Kingdom - {631, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel.Level", 80) }, //Icecrown Citadel - {632, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel5Man.Level", 78) }, // The Forge of Souls - {649, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentRaid.Level", 80) }, // Trial of the Crusader - {650, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentDungeon.Level", 80) }, //Trial of the Champion - {658, sConfigMgr->GetIntDefault("Solocraft.QuarryOfTears.Level", 78) }, // Pit of Saron - {668, sConfigMgr->GetIntDefault("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection - {724, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum - }; - - // Dungeon Difficulty - // Catch alls + + // Dungeon Base Level + dungeons = + { + // Wow Classic + {33, sConfigMgr->GetIntDefault("Solocraft.ShadowfangKeep.Level", 15) }, + {34, sConfigMgr->GetIntDefault("Solocraft.Stockades.Level", 22) }, + {36, sConfigMgr->GetIntDefault("Solocraft.Deadmines.Level", 18) }, + {43, sConfigMgr->GetIntDefault("Solocraft.WailingCaverns.Level", 17) }, + {47, sConfigMgr->GetIntDefault("Solocraft.RazorfenKraulInstance.Level", 30) }, + {48, sConfigMgr->GetIntDefault("Solocraft.Blackfathom.Level", 20) }, + {70, sConfigMgr->GetIntDefault("Solocraft.Uldaman.Level", 40) }, + {90, sConfigMgr->GetIntDefault("Solocraft.GnomeragonInstance.Level", 24) }, + {109, sConfigMgr->GetIntDefault("Solocraft.SunkenTemple.Level", 50) }, + {129, sConfigMgr->GetIntDefault("Solocraft.RazorfenDowns.Level", 40) }, + {189, sConfigMgr->GetIntDefault("Solocraft.MonasteryInstances.Level", 35) }, // Scarlet Monastery + {209, sConfigMgr->GetIntDefault("Solocraft.TanarisInstance.Level", 44) }, // Zul'Farrak + {229, sConfigMgr->GetIntDefault("Solocraft.BlackRockSpire.Level", 55) }, + {230, sConfigMgr->GetIntDefault("Solocraft.BlackrockDepths.Level", 50) }, + {249, sConfigMgr->GetIntDefault("Solocraft.OnyxiaLairInstance.Level", 60) }, + {289, sConfigMgr->GetIntDefault("Solocraft.SchoolofNecromancy.Level", 55) }, // Scholomance + {309, sConfigMgr->GetIntDefault("Solocraft.Zul'gurub.Level", 60) }, + {329, sConfigMgr->GetIntDefault("Solocraft.Stratholme.Level", 55) }, + {349, sConfigMgr->GetIntDefault("Solocraft.Mauradon.Level", 48) }, + {389, sConfigMgr->GetIntDefault("Solocraft.OrgrimmarInstance.Level", 15) }, // Ragefire Chasm + {409, sConfigMgr->GetIntDefault("Solocraft.MoltenCore.Level", 60) }, + {429, sConfigMgr->GetIntDefault("Solocraft.DireMaul.Level", 48) }, + {469, sConfigMgr->GetIntDefault("Solocraft.BlackwingLair.Level", 40) }, + {509, sConfigMgr->GetIntDefault("Solocraft.AhnQiraj.Level", 60) }, // Ruins of Ahn'Qiraj + {531, sConfigMgr->GetIntDefault("Solocraft.AhnQirajTemple.Level", 60) }, + + // BC Instances + {269, sConfigMgr->GetIntDefault("Solocraft.CavernsOfTime.Level", 68) }, // The Black Morass + {532, sConfigMgr->GetIntDefault("Solocraft.Karazahn.Level", 68) }, + {534, sConfigMgr->GetIntDefault("Solocraft.HyjalPast.Level", 70) }, // The Battle for Mount Hyjal - Hyjal Summit + {540, sConfigMgr->GetIntDefault("Solocraft.HellfireMilitary.Level", 68) }, // The Shattered Halls + {542, sConfigMgr->GetIntDefault("Solocraft.HellfireDemon.Level", 68) }, // The Blood Furnace + {543, sConfigMgr->GetIntDefault("Solocraft.HellfireRampart.Level", 68) }, + {544, sConfigMgr->GetIntDefault("Solocraft.HellfireRaid.Level", 68) }, // Magtheridon's Lair + {545, sConfigMgr->GetIntDefault("Solocraft.CoilfangPumping.Level", 68) }, // The Steamvault + {546, sConfigMgr->GetIntDefault("Solocraft.CoilfangMarsh.Level", 68) }, // The Underbog + {547, sConfigMgr->GetIntDefault("Solocraft.CoilfangDraenei.Level", 68) }, // The Slavepens + {548, sConfigMgr->GetIntDefault("Solocraft.CoilfangRaid.Level", 70) }, // Serpentshrine Cavern + {550, sConfigMgr->GetIntDefault("Solocraft.TempestKeepRaid.Level", 70) }, // The Eye + {552, sConfigMgr->GetIntDefault("Solocraft.TempestKeepArcane.Level", 68) }, // The Arcatraz + {553, sConfigMgr->GetIntDefault("Solocraft.TempestKeepAtrium.Level", 68) }, // The Botanica + {554, sConfigMgr->GetIntDefault("Solocraft.TempestKeepFactory.Level", 68) }, // The Mechanar + {555, sConfigMgr->GetIntDefault("Solocraft.AuchindounShadow.Level", 68) }, // Shadow Labyrinth + {556, sConfigMgr->GetIntDefault("Solocraft.AuchindounDemon.Level", 68) }, // Sethekk Halls + {557, sConfigMgr->GetIntDefault("Solocraft.AuchindounEthereal.Level", 68) }, // Mana-Tombs + {558, sConfigMgr->GetIntDefault("Solocraft.AuchindounDraenei.Level", 68) }, // Auchenai Crypts + {560, sConfigMgr->GetIntDefault("Solocraft.HillsbradPast.Level", 68) }, // Old Hillsbrad Foothills + {564, sConfigMgr->GetIntDefault("Solocraft.BlackTemple.Level", 70) }, + {565, sConfigMgr->GetIntDefault("Solocraft.GruulsLair.Level", 70) }, + {568, sConfigMgr->GetIntDefault("Solocraft.ZulAman.Level", 68) }, + {580, sConfigMgr->GetIntDefault("Solocraft.SunwellPlateau.Level", 70) }, + {585, sConfigMgr->GetIntDefault("Solocraft.Sunwell5ManFix.Level", 68) }, // Magister's Terrace + + // WOTLK Instances + {533, sConfigMgr->GetIntDefault("Solocraft.StratholmeRaid.Level", 78) }, // Naxxramas + {574, sConfigMgr->GetIntDefault("Solocraft.Valgarde70.Level", 78) }, // Utgarde Keep + {575, sConfigMgr->GetIntDefault("Solocraft.UtgardePinnacle.Level", 78) }, + {576, sConfigMgr->GetIntDefault("Solocraft.Nexus70.Level", 78) }, // The Nexus + {578, sConfigMgr->GetIntDefault("Solocraft.Nexus80.Level", 78) }, // The Occulus + {595, sConfigMgr->GetIntDefault("Solocraft.StratholmeCOT.Level", 78) }, // The Culling of Stratholme + {599, sConfigMgr->GetIntDefault("Solocraft.Ulduar70.Level", 78) }, // Halls of Stone + {600, sConfigMgr->GetIntDefault("Solocraft.DrakTheronKeep.Level", 78) }, // Drak'Tharon Keep + {601, sConfigMgr->GetIntDefault("Solocraft.Azjol_Uppercity.Level", 78) }, // Azjol-Nerub + {602, sConfigMgr->GetIntDefault("Solocraft.Ulduar80.Level", 78) }, // Halls of Lighting + {603, sConfigMgr->GetIntDefault("Solocraft.UlduarRaid.Level", 80) }, // Ulduar + {604, sConfigMgr->GetIntDefault("Solocraft.GunDrak.Level", 78) }, + {608, sConfigMgr->GetIntDefault("Solocraft.DalaranPrison.Level", 78) }, // Violet Hold + {615, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsBlack.Level", 80) }, // The Obsidian Sanctum + {616, sConfigMgr->GetIntDefault("Solocraft.NexusRaid.Level", 80) }, // The Eye of Eternity + {619, sConfigMgr->GetIntDefault("Solocraft.Azjol_LowerCity.Level", 78) }, // Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel.Level", 80) }, // Icecrown Citadel + {632, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel5Man.Level", 78) }, // The Forge of Souls + {649, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentRaid.Level", 80) }, // Trial of the Crusader + {650, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentDungeon.Level", 80) }, // Trial of the Champion + {658, sConfigMgr->GetIntDefault("Solocraft.QuarryOfTears.Level", 78) }, // Pit of Saron + {668, sConfigMgr->GetIntDefault("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection + {724, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum + }; + + // Dungeon Difficulty + // Catch alls D5 = sConfigMgr->GetFloatDefault("Solocraft.Dungeon", 5.0); D10 = sConfigMgr->GetFloatDefault("Solocraft.Heroic", 10.0); D25 = sConfigMgr->GetFloatDefault("Solocraft.Raid25", 25.0); D40 = sConfigMgr->GetFloatDefault("Solocraft.Raid40", 40.0); - - diff_Multiplier = - { - //WOW Classic Instances - {33, sConfigMgr->GetFloatDefault("Solocraft.ShadowfangKeep", 5.0) }, - {34, sConfigMgr->GetFloatDefault("Solocraft.Stockades", 5.0) }, - {36, sConfigMgr->GetFloatDefault("Solocraft.Deadmines", 5.0) }, - {43, sConfigMgr->GetFloatDefault("Solocraft.WailingCaverns", 5.0) }, - {47, sConfigMgr->GetFloatDefault("Solocraft.RazorfenKraulInstance", 5.0) }, - {48, sConfigMgr->GetFloatDefault("Solocraft.Blackfathom", 5.0) }, - {70, sConfigMgr->GetFloatDefault("Solocraft.Uldaman", 5.0) }, - {90, sConfigMgr->GetFloatDefault("Solocraft.GnomeragonInstance", 5.0) }, - {109, sConfigMgr->GetFloatDefault("Solocraft.SunkenTemple", 5.0) }, - {129, sConfigMgr->GetFloatDefault("Solocraft.RazorfenDowns", 5.0) }, - {189, sConfigMgr->GetFloatDefault("Solocraft.MonasteryInstances", 5.0) }, //Scarlet - {209, sConfigMgr->GetFloatDefault("Solocraft.TanarisInstance", 5.0) }, //Zul'Farrak - {229, sConfigMgr->GetFloatDefault("Solocraft.BlackRockSpire", 10.0) }, - {230, sConfigMgr->GetFloatDefault("Solocraft.BlackrockDepths", 5.0) }, - {249, sConfigMgr->GetFloatDefault("Solocraft.OnyxiaLairInstance", 40.0) }, - {289, sConfigMgr->GetFloatDefault("Solocraft.SchoolofNecromancy", 5.0) }, //Scholo - {309, sConfigMgr->GetFloatDefault("Solocraft.Zul'gurub", 20.0) }, - {329, sConfigMgr->GetFloatDefault("Solocraft.Stratholme", 5.0) }, - {349, sConfigMgr->GetFloatDefault("Solocraft.Mauradon", 5.0) }, - {389, sConfigMgr->GetFloatDefault("Solocraft.OrgrimmarInstance", 5.0) }, //Ragefire - {409, sConfigMgr->GetFloatDefault("Solocraft.MoltenCore", 40.0) }, - {429, sConfigMgr->GetFloatDefault("Solocraft.DireMaul", 5.0) }, - {469, sConfigMgr->GetFloatDefault("Solocraft.BlackwingLair", 40.0) }, - {509, sConfigMgr->GetFloatDefault("Solocraft.AhnQiraj", 20.0) }, - {531, sConfigMgr->GetFloatDefault("Solocraft.AhnQirajTemple", 40.0) }, - - //BC Instances - {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTime", 5.0) }, //Black Morass - {532, sConfigMgr->GetFloatDefault("Solocraft.Karazahn", 10.0) }, - {534, sConfigMgr->GetFloatDefault("Solocraft.HyjalPast", 25.0) }, //Mount Hyjal - {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitary", 5.0) }, //The Shattered Halls - {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemon", 5.0) }, //The Blood Furnace - {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampart", 5.0) }, - {544, sConfigMgr->GetFloatDefault("Solocraft.HellfireRaid", 25.0) }, //Magtheridon's Lair - {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumping", 5.0) }, //The Steamvault - {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarsh", 5.0) }, //The Underbog - {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraenei", 5.0) }, //The Slavepens - {548, sConfigMgr->GetFloatDefault("Solocraft.CoilfangRaid", 25.0) }, //Serpentshrine Cavern - {550, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepRaid", 25.0) }, //The Eye - {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcane", 5.0) }, //The Arcatraz - {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtrium", 5.0) }, //The Botanica - {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactory", 5.0) }, //The Mechanar - {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadow", 5.0) }, //Shadow Labyrinth - {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemon", 5.0) }, //Sethekk Halls - {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEthereal", 5.0) }, //Mana-Tombs - {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraenei", 5.0) }, //Auchenai Crypts - {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPast", 5.0) }, //Old Hillsbrad Foothills - {564, sConfigMgr->GetFloatDefault("Solocraft.BlackTemple", 25.0) }, - {565, sConfigMgr->GetFloatDefault("Solocraft.GruulsLair", 25.0) }, - {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAman", 5.0) }, - {580, sConfigMgr->GetFloatDefault("Solocraft.SunwellPlateau", 25.0) }, - {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFix", 5.0) }, //Magister's Terrace - - //WOTLK Instances - {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaid", 10.0) }, //Nax 10 - {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70", 5.0) }, //Utgarde Keep - {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacle", 5.0) }, - {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70", 5.0) }, //The Nexus - {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80", 5.0) }, //The Occulus - {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOT", 5.0) }, //The Culling of Stratholme - {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70", 5.0) }, //Halls of Stone - {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeep", 5.0) }, //Drak'Tharon Keep - {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_Uppercity", 5.0) }, //Azjol-Nerub - {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80", 5.0) }, //Halls of Lighting - {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaid", 10.0) }, //Ulduar 10 - {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrak", 5.0) }, - {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrison", 5.0) }, //Violet Hold - {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlack", 10.0) }, //The Obsidian Sanctum 10 - {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaid", 10.0) }, //The Eye of Eternity 10 - {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCity", 5.0) }, //Ahn'kahet: The Old Kingdom - {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel", 10.0) }, //Icecrown Citadel 10 - {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5Man", 5.0) }, //The Forge of Souls - {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaid", 10.0) }, //Trial of the Crusader 10 - {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeon", 5.0) }, //Trial of the Champion - {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTears", 5.0) }, //Pit of Saron - {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflection", 5.0) }, //Halls of Reflection - {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRed", 10.0) }, //The Ruby Sanctum 10 - }; - - - //Heroics - diff_Multiplier_Heroics = - { - //BC Instances Heroics - {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTimeH", 5.0) }, //Black Morass H - {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitaryH", 5.0) }, //The Shattered Halls H - {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemonH", 5.0) }, //The Blood Furnace H - {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampartH", 5.0) }, //Heroic - {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumpingH", 5.0) }, //The Steamvault - {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarshH", 5.0) }, //The Underbog - {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraeneiH", 5.0) }, //The Slavepens H - {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcaneH", 5.0) }, //The Arcatraz H - {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtriumH", 5.0) }, //The Botanica H - {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactoryH", 5.0) }, //The Mechanar H - {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadowH", 5.0) }, //Shadow Labyrinth H - {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemonH", 5.0) }, //Sethekk Halls H - {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEtherealH", 5.0) }, //Mana-Tombs H - {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraeneiH", 5.0) }, //Auchenai Crypts H - {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPastH", 5.0) }, //Old Hillsbrad Foothills H - {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAmanH", 5.0) }, //Zul'Aman H - {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFixH", 5.0) }, //Magister's Terrace H - - //WOTLK Instances Heroics - {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaidH", 25.0) }, //Nax 25 - {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70H", 5.0) }, //Utgarde Keep H - {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacleH", 5.0) }, //Utgarde Pinnacle H - {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70H", 5.0) }, //The Nexus H - {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80H", 5.0) }, //The Occulus H - {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOTH", 5.0) }, //The Culling of Stratholme H - {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70H", 5.0) }, //Halls of Stone H - {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeepH", 5.0) }, //Drak'Tharon Keep H - {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_UppercityH", 5.0) }, //Azjol-Nerub H - {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80H", 5.0) }, //Halls of Lighting H - {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaidH", 25.0) }, //Ulduar 25 - {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrakH", 5.0) }, //Gundrak H - {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrisonH", 5.0) }, //Violet Hold H - {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlackH", 25.0) }, //The Obsidian Sanctum 25 - {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaidH", 25.0) }, //The Eye of Eternity 25 - {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCityH", 5.0) }, //Ahn'kahet: The Old Kingdom H - {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadelH", 25.0) }, //Icecrown Citadel 25 - {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5ManH", 5.0) }, //The Forge of Souls - {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH", 25.0) }, //Trial of the Crusader 25 - {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeonH", 5.0) }, //Trial of the Champion H - {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTearsH", 5.0) }, //Pit of Saron H - {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflectionH", 5.0) }, //Halls of Reflection H - {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRedH", 25.0) }, //The Ruby Sanctum 25 - }; + + diff_Multiplier = + { + // WOW Classic Instances + {33, sConfigMgr->GetFloatDefault("Solocraft.ShadowfangKeep", 5.0) }, + {34, sConfigMgr->GetFloatDefault("Solocraft.Stockades", 5.0) }, + {36, sConfigMgr->GetFloatDefault("Solocraft.Deadmines", 5.0) }, + {43, sConfigMgr->GetFloatDefault("Solocraft.WailingCaverns", 5.0) }, + {47, sConfigMgr->GetFloatDefault("Solocraft.RazorfenKraulInstance", 5.0) }, + {48, sConfigMgr->GetFloatDefault("Solocraft.Blackfathom", 5.0) }, + {70, sConfigMgr->GetFloatDefault("Solocraft.Uldaman", 5.0) }, + {90, sConfigMgr->GetFloatDefault("Solocraft.GnomeragonInstance", 5.0) }, + {109, sConfigMgr->GetFloatDefault("Solocraft.SunkenTemple", 5.0) }, + {129, sConfigMgr->GetFloatDefault("Solocraft.RazorfenDowns", 5.0) }, + {189, sConfigMgr->GetFloatDefault("Solocraft.MonasteryInstances", 5.0) }, // Scarlet + {209, sConfigMgr->GetFloatDefault("Solocraft.TanarisInstance", 5.0) }, // Zul'Farrak + {229, sConfigMgr->GetFloatDefault("Solocraft.BlackRockSpire", 10.0) }, + {230, sConfigMgr->GetFloatDefault("Solocraft.BlackrockDepths", 5.0) }, + {249, sConfigMgr->GetFloatDefault("Solocraft.OnyxiaLairInstance", 40.0) }, + {289, sConfigMgr->GetFloatDefault("Solocraft.SchoolofNecromancy", 5.0) }, // Scholo + {309, sConfigMgr->GetFloatDefault("Solocraft.Zul'gurub", 20.0) }, + {329, sConfigMgr->GetFloatDefault("Solocraft.Stratholme", 5.0) }, + {349, sConfigMgr->GetFloatDefault("Solocraft.Mauradon", 5.0) }, + {389, sConfigMgr->GetFloatDefault("Solocraft.OrgrimmarInstance", 5.0) }, // Ragefire + {409, sConfigMgr->GetFloatDefault("Solocraft.MoltenCore", 40.0) }, + {429, sConfigMgr->GetFloatDefault("Solocraft.DireMaul", 5.0) }, + {469, sConfigMgr->GetFloatDefault("Solocraft.BlackwingLair", 40.0) }, + {509, sConfigMgr->GetFloatDefault("Solocraft.AhnQiraj", 20.0) }, + {531, sConfigMgr->GetFloatDefault("Solocraft.AhnQirajTemple", 40.0) }, + + // BC Instances + {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTime", 5.0) }, // Black Morass + {532, sConfigMgr->GetFloatDefault("Solocraft.Karazahn", 10.0) }, + {534, sConfigMgr->GetFloatDefault("Solocraft.HyjalPast", 25.0) }, // Mount Hyjal + {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitary", 5.0) }, // The Shattered Halls + {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemon", 5.0) }, // The Blood Furnace + {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampart", 5.0) }, + {544, sConfigMgr->GetFloatDefault("Solocraft.HellfireRaid", 25.0) }, // Magtheridon's Lair + {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumping", 5.0) }, // The Steamvault + {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarsh", 5.0) }, // The Underbog + {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraenei", 5.0) }, // The Slavepens + {548, sConfigMgr->GetFloatDefault("Solocraft.CoilfangRaid", 25.0) }, // Serpentshrine Cavern + {550, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepRaid", 25.0) }, // The Eye + {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcane", 5.0) }, // The Arcatraz + {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtrium", 5.0) }, // The Botanica + {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactory", 5.0) }, // The Mechanar + {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadow", 5.0) }, // Shadow Labyrinth + {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemon", 5.0) }, // Sethekk Halls + {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEthereal", 5.0) }, // Mana-Tombs + {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraenei", 5.0) }, // Auchenai Crypts + {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPast", 5.0) }, // Old Hillsbrad Foothills + {564, sConfigMgr->GetFloatDefault("Solocraft.BlackTemple", 25.0) }, + {565, sConfigMgr->GetFloatDefault("Solocraft.GruulsLair", 25.0) }, + {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAman", 5.0) }, + {580, sConfigMgr->GetFloatDefault("Solocraft.SunwellPlateau", 25.0) }, + {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFix", 5.0) }, // Magister's Terrace + + // WOTLK Instances + {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaid", 10.0) }, // Nax 10 + {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70", 5.0) }, // Utgarde Keep + {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacle", 5.0) }, + {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70", 5.0) }, // The Nexus + {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80", 5.0) }, // The Occulus + {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOT", 5.0) }, // The Culling of Stratholme + {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70", 5.0) }, // Halls of Stone + {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeep", 5.0) }, // Drak'Tharon Keep + {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_Uppercity", 5.0) }, // Azjol-Nerub + {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80", 5.0) }, // Halls of Lighting + {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaid", 10.0) }, // Ulduar 10 + {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrak", 5.0) }, + {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrison", 5.0) }, // Violet Hold + {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlack", 10.0) }, // The Obsidian Sanctum 10 + {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaid", 10.0) }, // The Eye of Eternity 10 + {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCity", 5.0) }, // Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel", 10.0) }, // Icecrown Citadel 10 + {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5Man", 5.0) }, // The Forge of Souls + {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaid", 10.0) }, // Trial of the Crusader 10 + {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeon", 5.0) }, // Trial of the Champion + {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTears", 5.0) }, // Pit of Saron + {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflection", 5.0) }, // Halls of Reflection + {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRed", 10.0) }, // The Ruby Sanctum 10 + }; + + + // Heroics + diff_Multiplier_Heroics = + { + // BC Instances Heroics + {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTimeH", 5.0) }, // Black Morass H + {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitaryH", 5.0) }, // The Shattered Halls H + {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemonH", 5.0) }, // The Blood Furnace H + {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampartH", 5.0) }, // Heroic + {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumpingH", 5.0) }, // The Steamvault + {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarshH", 5.0) }, // The Underbog + {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraeneiH", 5.0) }, // The Slavepens H + {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcaneH", 5.0) }, // The Arcatraz H + {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtriumH", 5.0) }, // The Botanica H + {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactoryH", 5.0) }, // The Mechanar H + {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadowH", 5.0) }, // Shadow Labyrinth H + {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemonH", 5.0) }, // Sethekk Halls H + {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEtherealH", 5.0) }, // Mana-Tombs H + {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraeneiH", 5.0) }, // Auchenai Crypts H + {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPastH", 5.0) }, // Old Hillsbrad Foothills H + {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAmanH", 5.0) }, // Zul'Aman H + {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFixH", 5.0) }, // Magister's Terrace H + + // WOTLK Instances Heroics + {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaidH", 25.0) }, // Naxxramas 25 + {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70H", 5.0) }, // Utgarde Keep H + {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacleH", 5.0) }, // Utgarde Pinnacle H + {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70H", 5.0) }, // The Nexus H + {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80H", 5.0) }, // The Occulus H + {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOTH", 5.0) }, // The Culling of Stratholme H + {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70H", 5.0) }, // Halls of Stone H + {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeepH", 5.0) }, // Drak'Tharon Keep H + {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_UppercityH", 5.0) }, // Azjol-Nerub H + {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80H", 5.0) }, // Halls of Lighting H + {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaidH", 25.0) }, // Ulduar 25 + {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrakH", 5.0) }, // Gundrak H + {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrisonH", 5.0) }, // Violet Hold H + {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlackH", 25.0) }, // The Obsidian Sanctum 25 + {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaidH", 25.0) }, // The Eye of Eternity 25 + {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCityH", 5.0) }, // Ahn'kahet: The Old Kingdom H + {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadelH", 25.0) }, // Icecrown Citadel 25 + {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5ManH", 5.0) }, // The Forge of Souls + {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH", 25.0) }, // Trial of the Crusader 25 + {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeonH", 5.0) }, // Trial of the Champion H + {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTearsH", 5.0) }, // Pit of Saron H + {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflectionH", 5.0) }, // Halls of Reflection H + {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRedH", 25.0) }, // The Ruby Sanctum 25 + }; + //Unique Raids beyond the heroic and normal versions of themselves D649H10 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic @@ -568,4 +570,4 @@ void AddSolocraftScripts() new SolocraftConfig(); new SolocraftAnnounce(); new solocraft_player_instance_handler(); -} \ No newline at end of file +} From 0e52689d8cf29893a76c3b92c0a9130051bdfa87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Thu, 4 Feb 2021 22:49:23 +0100 Subject: [PATCH 23/46] docs(readme): update readme, close #15 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9713b74..2919a88 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ ``` 1) Simply place the module under the `modules` directory of your AzerothCore source. -2) Import the SQL to the right Database (world) +2) Import the SQL to the right Database (character) 3) Re-run cmake and launch a clean build of AzerothCore. ``` From 246989c42f136e98be8417af41a990fc6bc6933f Mon Sep 17 00:00:00 2001 From: Helias Date: Thu, 4 Feb 2021 22:51:45 +0100 Subject: [PATCH 24/46] chore(directory): rename directory --- data/sql/{db-world => db-characters}/Solocraft.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data/sql/{db-world => db-characters}/Solocraft.sql (100%) diff --git a/data/sql/db-world/Solocraft.sql b/data/sql/db-characters/Solocraft.sql similarity index 100% rename from data/sql/db-world/Solocraft.sql rename to data/sql/db-characters/Solocraft.sql From af475b771d839bf2944da3b0cdc3f9c967ccc049 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 3 Mar 2021 14:43:24 +0300 Subject: [PATCH 25/46] Fix for last PR ACE remove https://github.com/azerothcore/azerothcore-wotlk/pull/4608 --- src/Solocraft.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 85276a0..472eb7f 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -38,13 +38,6 @@ class SolocraftConfig : public WorldScript void OnBeforeConfigLoad(bool reload) override { if (!reload) { - std::string conf_path = _CONF_DIR; - std::string cfg_file = conf_path + "/Solocraft.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 SetInitialWorldSettings(); } From becf2c84ba9d6db86688db41841f1ea1cfa3a9ee Mon Sep 17 00:00:00 2001 From: Lanny Ellis Date: Tue, 6 Apr 2021 14:25:47 -0600 Subject: [PATCH 26/46] Fix Dungeon Hoping Continually Increasing Stats Closes issue #18 --- src/Solocraft.cpp | 55 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 472eb7f..6501b08 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -308,6 +308,16 @@ class SolocraftAnnounce : public PlayerScript } } } + void OnLogout(Player* player) + { + //Database query to see if an entry is still there + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID()); + if (result) + { + //Remove database entry as the player has logged out + CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID()); + } + } }; class solocraft_player_instance_handler : public PlayerScript { @@ -406,14 +416,17 @@ class solocraft_player_instance_handler : public PlayerScript { // Apply the player buffs void ApplyBuffs(Player* player, Map* map, float difficulty, int dunLevel, int numInGroup) - { - int SpellPowerBonus = 0; + { + //Check whether to buff the player or check to debuff back to normal + if (difficulty != 0) + { + std::ostringstream ss; + - //Check whether to buff the player or check to debuff back to normal - if (difficulty != 0) - { - std::ostringstream ss; + int SpellPowerBonus = 0; + // int SpellPowerBonusDB = 0; + if (player->getLevel() <= dunLevel + SolocraftLevelDiff) //If a player is too high level for dungeon don't buff but if in a group will count towards the group offset balancing. { @@ -438,10 +451,18 @@ class solocraft_player_instance_handler : public PlayerScript { difficulty = roundf(difficulty * 100) / 100; //Float variables suck - two decimal rounding } - + + //Check Database for a current dungeon entry + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID()); + //Modify Player Stats for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h { + //Check for Dungeon to Dungeon Transfer and remove old buff + if (result) + { + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].GetFloat() * (*result)[4].GetFloat(), false); + } // Buff the player player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * SoloCraftStatsMult, true); //Unitmods enum UNIT_MOD_STAT_START defined in Unit.h line 391 @@ -455,9 +476,19 @@ class solocraft_player_instance_handler : public PlayerScript { { // Buff the player's mana player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); + + + //Check for Dungeon to Dungeon Transfer and remove old Spellpower buff + if (result) + { + // remove spellpower bonus + player->ApplySpellPowerBonus((*result)[3].GetUInt32() * (*result)[4].GetFloat(),false); + } + //Buff Spellpower if (difficulty > 0) //Debuffed characters do not get spellpower { + SpellPowerBonus = static_cast((player->getLevel() * SoloCraftSpellMult) * difficulty);//Yes, I pulled this calc out of my butt. player->ApplySpellPowerBonus(SpellPowerBonus,true); //sLog->outError("%u: spellpower Bonus applied: %i", player->GetGUID(), SpellPowerBonus); @@ -480,17 +511,21 @@ class solocraft_player_instance_handler : public PlayerScript { // Save Player Dungeon Offsets to Database CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); + } else { // Announce to player - Over Max Level Threshold ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000You have not been buffed. |cffFF8000 Your level is higher than the max level (%i) threshold for this dungeon."; ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), dunLevel + SolocraftLevelDiff); + ClearBuffs(player, map); //Check to revert player back to normal } - - } - else + + } + else + { ClearBuffs(player, map); //Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues + } } // Get the current group members GUIDS and return the total sum of the difficulty offset by all group members currently in the dungeon From d38a092f9212917a16a1681d68f985d3f4f696e5 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 30 Apr 2021 16:11:46 -0600 Subject: [PATCH 27/46] fix(core): Modified to compile with new ObjectGuid update --- src/Solocraft.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 6501b08..2c73800 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -311,11 +311,11 @@ class SolocraftAnnounce : public PlayerScript void OnLogout(Player* player) { //Database query to see if an entry is still there - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID()); + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); if (result) { //Remove database entry as the player has logged out - CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID()); + CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); } } }; @@ -453,7 +453,7 @@ class solocraft_player_instance_handler : public PlayerScript { } //Check Database for a current dungeon entry - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID()); + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); //Modify Player Stats for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h @@ -510,7 +510,7 @@ class solocraft_player_instance_handler : public PlayerScript { } // Save Player Dungeon Offsets to Database - CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); + CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); } else @@ -541,7 +541,7 @@ class solocraft_player_instance_handler : public PlayerScript { if (itr->guid != player->GetGUID()) { //Database query to find difficulty for each group member that is currently in an instance - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = %u", itr->guid); + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = %u", itr->guid.GetCounter()); if (result) { //Test for debuffs already give to other members - They cannot be used to determine the total offset because negative numbers will skew the total difficulty offset @@ -561,7 +561,7 @@ class solocraft_player_instance_handler : public PlayerScript { { //Database query to get offset from the last instance player exited - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID()); + QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); if (result) { float difficulty = (*result)[1].GetFloat(); @@ -588,7 +588,7 @@ class solocraft_player_instance_handler : public PlayerScript { } //Remove database entry as the player is no longer in an instance - CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID()); + CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); } } }; From 819650a82d38a1f35a29944f7b518f76f792165a Mon Sep 17 00:00:00 2001 From: BytesGalore <3903215+BytesGalore@users.noreply.github.com> Date: Fri, 17 Sep 2021 18:00:22 +0200 Subject: [PATCH 28/46] refactor: updated module registration to core rev 4++ --- .github/workflows/core-build.yml | 4 ++-- CMakeLists.txt | 6 ------ src/SC_loader.cpp | 6 ++++++ src/loader.h | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 CMakeLists.txt create mode 100644 src/SC_loader.cpp delete mode 100644 src/loader.h diff --git a/.github/workflows/core-build.yml b/.github/workflows/core-build.yml index 47c5a49..24ca5be 100644 --- a/.github/workflows/core-build.yml +++ b/.github/workflows/core-build.yml @@ -8,8 +8,8 @@ jobs: strategy: fail-fast: false matrix: - compiler: [clang6, clang9, clang10] - runs-on: ubuntu-20.04 + compiler: [clang] + runs-on: ubuntu-latest name: ${{ matrix.compiler }} env: COMPILER: ${{ matrix.compiler }} diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index b6fed52..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ - -AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Solocraft.cpp") - -AC_ADD_SCRIPT_LOADER("Solocraft" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h") - -AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/Solocraft.conf.dist") diff --git a/src/SC_loader.cpp b/src/SC_loader.cpp new file mode 100644 index 0000000..5be0f48 --- /dev/null +++ b/src/SC_loader.cpp @@ -0,0 +1,6 @@ +void AddSolocraftScripts(); + +void Addmod_solocraftScripts() +{ + AddSolocraftScripts(); +} diff --git a/src/loader.h b/src/loader.h deleted file mode 100644 index bc367fe..0000000 --- a/src/loader.h +++ /dev/null @@ -1 +0,0 @@ -void AddSolocraftScripts(); From 1e76a3150a576779f2af2822a06bee37e72dc95a Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 26 Jan 2022 14:32:45 -0700 Subject: [PATCH 29/46] fix(cpp/conf) Add Class Balancing Added Class Balancing to cpp and conf Closes issue #21 --- conf/Solocraft.conf.dist | 26 ++++++++- src/Solocraft.cpp | 119 ++++++++++++++++++++++----------------- 2 files changed, 90 insertions(+), 55 deletions(-) diff --git a/conf/Solocraft.conf.dist b/conf/Solocraft.conf.dist index e866c3f..dda0ada 100644 --- a/conf/Solocraft.conf.dist +++ b/conf/Solocraft.conf.dist @@ -21,7 +21,7 @@ Solocraft.Announce = 1 ################################################################################################### -# Balancing - Groups (Overloading), Spellpower, and Stats +# Balancing - Groups (Overloading), Global Spellpower and Stats modifier, Global Class Balancing ################################################################################################### # Enable Debuff of new party members who enter the dungeon to avoid overloading the dungeon? @@ -38,7 +38,7 @@ SoloCraft.Debuff.Enable = 1 # Spellpower Bonus Multiplier # Spellcasters spellpower bonus multiplier to offset no spellpower received from stats -# Formula: (player->level * multiplier) * difficulty +# Formula: (player->level * multiplier) * ((classBalance / 100) * difficulty) # Example Level 24 Mage with default modifier and a dungeon difficulty of 5 will receive a base # Spellpower increase of 300. @@ -48,13 +48,33 @@ SoloCraft.Spellpower.Mult = 2.5 # Stats Percentage Bonus Multiplier -# Forumla: player->Stats * (difficulty * multiplier) +# Forumla: player->Stats * (((classBalance / 100) * difficulty) * multiplier) # Default: 100.0 # 0.0 (Disable) SoloCraft.Stats.Mult = 100.0 +# Class Balancing Modifier +# This settings will only allow the percentage specified of the difficulty for the specified class +# Example Level 24 Mage with default modifier (2.5), a dungeon difficulty of 5, and a 80 percent class +# balance modifier will receive a base Spellpower increase of 240. +# Note: 0 will completely disable the class from receiving difficulty modifiers from any dungeon + +#Default: 100 (Full Dungeon Difficulty Modifer will be Applied) +# 0 (Disable) - 100 + +SoloCraft.DEATH_KNIGHT = 100 +SoloCraft.DRUID = 100 +SoloCraft.HUNTER = 100 +SoloCraft.MAGE = 100 +SoloCraft.PALADIN = 100 +SoloCraft.PRIEST = 100 +SoloCraft.ROGUE = 100 +SoloCraft.SHAMAN = 100 +SoloCraft.WARLOCK = 100 +SoloCraft.WARRIOR = 100 + ################################################################################################ #Catch all Bucket - Difficulty Offset Defaults ################################################################################################ diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 2c73800..2bede50 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -1,4 +1,5 @@ #include +#include "Log.h" #include "Config.h" #include "ScriptMgr.h" #include "Unit.h" @@ -18,6 +19,7 @@ float SoloCraftSpellMult = 1.0; float SoloCraftStatsMult = 100.0; uint32 SolocraftLevelDiff = 1; uint32 SolocraftDungeonLevel = 1; +std::unordered_map classes; std::unordered_map dungeons; std::unordered_map diff_Multiplier; std::unordered_map diff_Multiplier_Heroics; @@ -29,7 +31,6 @@ float D40 = 1.0; float D649H10 = 1.0; float D649H25 = 1.0; - class SolocraftConfig : public WorldScript { public: @@ -53,6 +54,19 @@ class SolocraftConfig : public WorldScript SoloCraftDebuffEnable = sConfigMgr->GetBoolDefault("SoloCraft.Debuff.Enable", 1); SoloCraftSpellMult = sConfigMgr->GetFloatDefault("SoloCraft.Spellpower.Mult", 2.5); SoloCraftStatsMult = sConfigMgr->GetFloatDefault("SoloCraft.Stats.Mult", 100.0); + classes = + { + {1, sConfigMgr->GetIntDefault("SoloCraft.WARRIOR", 100) }, + {2, sConfigMgr->GetIntDefault("SoloCraft.PALADIN", 100) }, + {3, sConfigMgr->GetIntDefault("SoloCraft.HUNTER", 100) }, + {4, sConfigMgr->GetIntDefault("SoloCraft.ROGUE", 100) }, + {5, sConfigMgr->GetIntDefault("SoloCraft.PRIEST", 100) }, + {6, sConfigMgr->GetIntDefault("SoloCraft.DEATH_KNIGHT", 100) }, + {7, sConfigMgr->GetIntDefault("SoloCraft.SHAMAN", 100) }, + {8, sConfigMgr->GetIntDefault("SoloCraft.MAGE", 100) }, + {9, sConfigMgr->GetIntDefault("SoloCraft.WARLOCK", 100) }, + {11, sConfigMgr->GetIntDefault("SoloCraft.DRUID", 100) }, + }; //Level Thresholds SolocraftLevelDiff = sConfigMgr->GetIntDefault("Solocraft.Max.Level.Diff", 10); @@ -60,7 +74,6 @@ class SolocraftConfig : public WorldScript //Catch All Dungeon Level Threshold SolocraftDungeonLevel = sConfigMgr->GetIntDefault("Solocraft.Dungeon.Level", 80); - // Dungeon Base Level dungeons = { @@ -233,7 +246,6 @@ class SolocraftConfig : public WorldScript {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRed", 10.0) }, // The Ruby Sanctum 10 }; - // Heroics diff_Multiplier_Heroics = { @@ -282,7 +294,6 @@ class SolocraftConfig : public WorldScript {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRedH", 25.0) }, // The Ruby Sanctum 25 }; - //Unique Raids beyond the heroic and normal versions of themselves D649H10 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic D649H25 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic @@ -317,7 +328,7 @@ class SolocraftAnnounce : public PlayerScript //Remove database entry as the player has logged out CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); } - } + } }; class solocraft_player_instance_handler : public PlayerScript { @@ -333,7 +344,8 @@ class solocraft_player_instance_handler : public PlayerScript { float difficulty = CalculateDifficulty(map, player); int dunLevel = CalculateDungeonLevel(map, player); int numInGroup = GetNumInGroup(player); - ApplyBuffs(player, map, difficulty, dunLevel, numInGroup); + int classBalance = GetClassBalance(player); + ApplyBuffs(player, map, difficulty, dunLevel, numInGroup, classBalance); } } @@ -341,7 +353,6 @@ class solocraft_player_instance_handler : public PlayerScript { std::map _unitDifficulty; - // Set the instance difficulty int CalculateDifficulty(Map* map, Player* /*player*/) { //float difficulty = 0.0;//changed from 1.0 @@ -359,8 +370,7 @@ class solocraft_player_instance_handler : public PlayerScript { else return diff_Multiplier_Heroics[map->GetId()]; //return the specific dungeon's level } - - + if (map->IsHeroic()) { //WOTLK 10 Man Heroic @@ -372,8 +382,7 @@ class solocraft_player_instance_handler : public PlayerScript { } else return diff_Multiplier_Heroics[map->GetId()]; //return the specific dungeon's level - } - + } if (diff_Multiplier.find(map->GetId()) == diff_Multiplier.end()) { //Catch Alls ----------------------5 Dungeons and 40 Raids @@ -390,8 +399,6 @@ class solocraft_player_instance_handler : public PlayerScript { return 0; //return 0 } - - // Set the Dungeon Level int CalculateDungeonLevel(Map* map, Player* /*player*/) { if (dungeons.find(map->GetId()) == dungeons.end()) @@ -400,8 +407,7 @@ class solocraft_player_instance_handler : public PlayerScript { } else return dungeons[map->GetId()]; //return the specific dungeon's level - } - + } // Get the group's size int GetNumInGroup(Player* player) { @@ -414,53 +420,65 @@ class solocraft_player_instance_handler : public PlayerScript { return numInGroup; } + // Get the Player's class balance debuff + int GetClassBalance(Player* player) { + int classBalance = 100; + + if(classes.find(player->getClass()) == classes.end()){ + return classBalance; //class not found returns the catch all value + } + else if (classes[player->getClass()] >= 0 && classes[player->getClass()] <= 100) { + return classes[player->getClass()]; //return the specific class's Balance value + } + else + return classBalance; //class balance value invalid returns the catch all value + } + // Apply the player buffs - void ApplyBuffs(Player* player, Map* map, float difficulty, int dunLevel, int numInGroup) - { + void ApplyBuffs(Player* player, Map* map, float difficulty, int dunLevel, int numInGroup, int classBalance) + { //Check whether to buff the player or check to debuff back to normal if (difficulty != 0) - { + { std::ostringstream ss; - int SpellPowerBonus = 0; - // int SpellPowerBonusDB = 0; - - + if (player->getLevel() <= dunLevel + SolocraftLevelDiff) //If a player is too high level for dungeon don't buff but if in a group will count towards the group offset balancing. { - + //Get Current members total difficulty offset and if it exceeds the difficulty offset of the dungeon then debuff new group members coming in until all members leave and re-enter. This happens when a player already inside dungeon invite others to the group but the player already has the full difficulty offset. float GroupDifficulty = GetGroupDifficulty(player); //Check to either debuff or buff player entering dungeon. Debuff must be enabled in Config if (GroupDifficulty >= difficulty && SoloCraftDebuffEnable == 1) { - //Current dungeon offset exceeded - Debuff player - difficulty = (-abs(difficulty)) + (difficulty / numInGroup); + //Current dungeon offset exceeded - Debuff player modified by ClassBalance Adjustment + difficulty = (-abs(difficulty)) + ((((float)classBalance / 100) * difficulty) / numInGroup); difficulty = roundf(difficulty * 100) / 100; //Float variables suck - //sLog->outError("%u: would have this difficulty: %f", player->GetGUID(), tempDiff); - + //LOG_INFO("server.loading", "Group Difficulty %f", GroupDifficulty ); //New Logging system } else { //Current Dungeon offset not exceeded - Buff player - //Group difficulty adjustment - difficulty = difficulty / numInGroup; + //Group difficulty and ClassBalance Adjustment + difficulty = (((float)classBalance / 100) * difficulty) / numInGroup; difficulty = roundf(difficulty * 100) / 100; //Float variables suck - two decimal rounding - + + //LOG_INFO("server.loading", "Difficulty %f", difficulty ); //New Logging System + } - + //Check Database for a current dungeon entry QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); - + //Modify Player Stats for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h { //Check for Dungeon to Dungeon Transfer and remove old buff - if (result) - { + if (result) + { player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].GetFloat() * (*result)[4].GetFloat(), false); } // Buff the player @@ -470,21 +488,20 @@ class solocraft_player_instance_handler : public PlayerScript { // Set player health player->SetFullHealth();//defined in Unit.h line 1524 - + //Spellcaster Stat modify if (player->getPowerType() == POWER_MANA) { // Buff the player's mana player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); - - - //Check for Dungeon to Dungeon Transfer and remove old Spellpower buff - if (result) - { + + //Check for Dungeon to Dungeon Transfer and remove old Spellpower buff + if (result) + { // remove spellpower bonus - player->ApplySpellPowerBonus((*result)[3].GetUInt32() * (*result)[4].GetFloat(),false); - } - + player->ApplySpellPowerBonus((*result)[3].GetUInt32() * (*result)[4].GetFloat(),false); + } + //Buff Spellpower if (difficulty > 0) //Debuffed characters do not get spellpower { @@ -499,19 +516,18 @@ class solocraft_player_instance_handler : public PlayerScript { if (difficulty > 0) { // Announce to player - Buff - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i"; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus); + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); } else { // Announce to player - Debuff - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty); + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); } // Save Player Dungeon Offsets to Database CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); - } else { @@ -520,7 +536,6 @@ class solocraft_player_instance_handler : public PlayerScript { ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), dunLevel + SolocraftLevelDiff); ClearBuffs(player, map); //Check to revert player back to normal } - } else { @@ -581,11 +596,11 @@ class solocraft_player_instance_handler : public PlayerScript { player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * StatsMultPct, false); } if (player->getPowerType() == POWER_MANA && difficulty > 0) - { + { // remove spellpower bonus player->ApplySpellPowerBonus(SpellPowerBonus,false); - //sLog->outError("%u: spellpower Bonus removed: %i", player->GetGUID(), SpellPowerBonus); - } + //sLog->outError("%u: spellpower Bonus removed: %i", player->GetGUID(), SpellPowerBonus); + } //Remove database entry as the player is no longer in an instance CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); From 66a70f307be469bb978fe4629cf5fd8d265798fe Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 26 Jan 2022 16:09:51 -0700 Subject: [PATCH 30/46] fix(cpp): GetOption Update Update code to use GetOption --- src/Solocraft.cpp | 420 +++++++++++++++++++++++----------------------- 1 file changed, 210 insertions(+), 210 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 2bede50..dfe2687 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -47,256 +47,256 @@ class SolocraftConfig : public WorldScript // Load Configuration Settings void SetInitialWorldSettings() { - SoloCraftEnable = sConfigMgr->GetBoolDefault("Solocraft.Enable", 1); - SoloCraftAnnounceModule = sConfigMgr->GetBoolDefault("Solocraft.Announce", 1); + SoloCraftEnable = sConfigMgr->GetOption("Solocraft.Enable", 1); + SoloCraftAnnounceModule = sConfigMgr->GetOption("Solocraft.Announce", 1); //Balancing - SoloCraftDebuffEnable = sConfigMgr->GetBoolDefault("SoloCraft.Debuff.Enable", 1); - SoloCraftSpellMult = sConfigMgr->GetFloatDefault("SoloCraft.Spellpower.Mult", 2.5); - SoloCraftStatsMult = sConfigMgr->GetFloatDefault("SoloCraft.Stats.Mult", 100.0); + SoloCraftDebuffEnable = sConfigMgr->GetOption("SoloCraft.Debuff.Enable", 1); + SoloCraftSpellMult = sConfigMgr->GetOption("SoloCraft.Spellpower.Mult", 2.5); + SoloCraftStatsMult = sConfigMgr->GetOption("SoloCraft.Stats.Mult", 100.0); classes = { - {1, sConfigMgr->GetIntDefault("SoloCraft.WARRIOR", 100) }, - {2, sConfigMgr->GetIntDefault("SoloCraft.PALADIN", 100) }, - {3, sConfigMgr->GetIntDefault("SoloCraft.HUNTER", 100) }, - {4, sConfigMgr->GetIntDefault("SoloCraft.ROGUE", 100) }, - {5, sConfigMgr->GetIntDefault("SoloCraft.PRIEST", 100) }, - {6, sConfigMgr->GetIntDefault("SoloCraft.DEATH_KNIGHT", 100) }, - {7, sConfigMgr->GetIntDefault("SoloCraft.SHAMAN", 100) }, - {8, sConfigMgr->GetIntDefault("SoloCraft.MAGE", 100) }, - {9, sConfigMgr->GetIntDefault("SoloCraft.WARLOCK", 100) }, - {11, sConfigMgr->GetIntDefault("SoloCraft.DRUID", 100) }, + {1, sConfigMgr->GetOption("SoloCraft.WARRIOR", 100) }, + {2, sConfigMgr->GetOption("SoloCraft.PALADIN", 100) }, + {3, sConfigMgr->GetOption("SoloCraft.HUNTER", 100) }, + {4, sConfigMgr->GetOption("SoloCraft.ROGUE", 100) }, + {5, sConfigMgr->GetOption("SoloCraft.PRIEST", 100) }, + {6, sConfigMgr->GetOption("SoloCraft.DEATH_KNIGHT", 100) }, + {7, sConfigMgr->GetOption("SoloCraft.SHAMAN", 100) }, + {8, sConfigMgr->GetOption("SoloCraft.MAGE", 100) }, + {9, sConfigMgr->GetOption("SoloCraft.WARLOCK", 100) }, + {11, sConfigMgr->GetOption("SoloCraft.DRUID", 100) }, }; //Level Thresholds - SolocraftLevelDiff = sConfigMgr->GetIntDefault("Solocraft.Max.Level.Diff", 10); + SolocraftLevelDiff = sConfigMgr->GetOption("Solocraft.Max.Level.Diff", 10); //Catch All Dungeon Level Threshold - SolocraftDungeonLevel = sConfigMgr->GetIntDefault("Solocraft.Dungeon.Level", 80); + SolocraftDungeonLevel = sConfigMgr->GetOption("Solocraft.Dungeon.Level", 80); // Dungeon Base Level dungeons = { // Wow Classic - {33, sConfigMgr->GetIntDefault("Solocraft.ShadowfangKeep.Level", 15) }, - {34, sConfigMgr->GetIntDefault("Solocraft.Stockades.Level", 22) }, - {36, sConfigMgr->GetIntDefault("Solocraft.Deadmines.Level", 18) }, - {43, sConfigMgr->GetIntDefault("Solocraft.WailingCaverns.Level", 17) }, - {47, sConfigMgr->GetIntDefault("Solocraft.RazorfenKraulInstance.Level", 30) }, - {48, sConfigMgr->GetIntDefault("Solocraft.Blackfathom.Level", 20) }, - {70, sConfigMgr->GetIntDefault("Solocraft.Uldaman.Level", 40) }, - {90, sConfigMgr->GetIntDefault("Solocraft.GnomeragonInstance.Level", 24) }, - {109, sConfigMgr->GetIntDefault("Solocraft.SunkenTemple.Level", 50) }, - {129, sConfigMgr->GetIntDefault("Solocraft.RazorfenDowns.Level", 40) }, - {189, sConfigMgr->GetIntDefault("Solocraft.MonasteryInstances.Level", 35) }, // Scarlet Monastery - {209, sConfigMgr->GetIntDefault("Solocraft.TanarisInstance.Level", 44) }, // Zul'Farrak - {229, sConfigMgr->GetIntDefault("Solocraft.BlackRockSpire.Level", 55) }, - {230, sConfigMgr->GetIntDefault("Solocraft.BlackrockDepths.Level", 50) }, - {249, sConfigMgr->GetIntDefault("Solocraft.OnyxiaLairInstance.Level", 60) }, - {289, sConfigMgr->GetIntDefault("Solocraft.SchoolofNecromancy.Level", 55) }, // Scholomance - {309, sConfigMgr->GetIntDefault("Solocraft.Zul'gurub.Level", 60) }, - {329, sConfigMgr->GetIntDefault("Solocraft.Stratholme.Level", 55) }, - {349, sConfigMgr->GetIntDefault("Solocraft.Mauradon.Level", 48) }, - {389, sConfigMgr->GetIntDefault("Solocraft.OrgrimmarInstance.Level", 15) }, // Ragefire Chasm - {409, sConfigMgr->GetIntDefault("Solocraft.MoltenCore.Level", 60) }, - {429, sConfigMgr->GetIntDefault("Solocraft.DireMaul.Level", 48) }, - {469, sConfigMgr->GetIntDefault("Solocraft.BlackwingLair.Level", 40) }, - {509, sConfigMgr->GetIntDefault("Solocraft.AhnQiraj.Level", 60) }, // Ruins of Ahn'Qiraj - {531, sConfigMgr->GetIntDefault("Solocraft.AhnQirajTemple.Level", 60) }, + {33, sConfigMgr->GetOption("Solocraft.ShadowfangKeep.Level", 15) }, + {34, sConfigMgr->GetOption("Solocraft.Stockades.Level", 22) }, + {36, sConfigMgr->GetOption("Solocraft.Deadmines.Level", 18) }, + {43, sConfigMgr->GetOption("Solocraft.WailingCaverns.Level", 17) }, + {47, sConfigMgr->GetOption("Solocraft.RazorfenKraulInstance.Level", 30) }, + {48, sConfigMgr->GetOption("Solocraft.Blackfathom.Level", 20) }, + {70, sConfigMgr->GetOption("Solocraft.Uldaman.Level", 40) }, + {90, sConfigMgr->GetOption("Solocraft.GnomeragonInstance.Level", 24) }, + {109, sConfigMgr->GetOption("Solocraft.SunkenTemple.Level", 50) }, + {129, sConfigMgr->GetOption("Solocraft.RazorfenDowns.Level", 40) }, + {189, sConfigMgr->GetOption("Solocraft.MonasteryInstances.Level", 35) }, // Scarlet Monastery + {209, sConfigMgr->GetOption("Solocraft.TanarisInstance.Level", 44) }, // Zul'Farrak + {229, sConfigMgr->GetOption("Solocraft.BlackRockSpire.Level", 55) }, + {230, sConfigMgr->GetOption("Solocraft.BlackrockDepths.Level", 50) }, + {249, sConfigMgr->GetOption("Solocraft.OnyxiaLairInstance.Level", 60) }, + {289, sConfigMgr->GetOption("Solocraft.SchoolofNecromancy.Level", 55) }, // Scholomance + {309, sConfigMgr->GetOption("Solocraft.Zul'gurub.Level", 60) }, + {329, sConfigMgr->GetOption("Solocraft.Stratholme.Level", 55) }, + {349, sConfigMgr->GetOption("Solocraft.Mauradon.Level", 48) }, + {389, sConfigMgr->GetOption("Solocraft.OrgrimmarInstance.Level", 15) }, // Ragefire Chasm + {409, sConfigMgr->GetOption("Solocraft.MoltenCore.Level", 60) }, + {429, sConfigMgr->GetOption("Solocraft.DireMaul.Level", 48) }, + {469, sConfigMgr->GetOption("Solocraft.BlackwingLair.Level", 40) }, + {509, sConfigMgr->GetOption("Solocraft.AhnQiraj.Level", 60) }, // Ruins of Ahn'Qiraj + {531, sConfigMgr->GetOption("Solocraft.AhnQirajTemple.Level", 60) }, // BC Instances - {269, sConfigMgr->GetIntDefault("Solocraft.CavernsOfTime.Level", 68) }, // The Black Morass - {532, sConfigMgr->GetIntDefault("Solocraft.Karazahn.Level", 68) }, - {534, sConfigMgr->GetIntDefault("Solocraft.HyjalPast.Level", 70) }, // The Battle for Mount Hyjal - Hyjal Summit - {540, sConfigMgr->GetIntDefault("Solocraft.HellfireMilitary.Level", 68) }, // The Shattered Halls - {542, sConfigMgr->GetIntDefault("Solocraft.HellfireDemon.Level", 68) }, // The Blood Furnace - {543, sConfigMgr->GetIntDefault("Solocraft.HellfireRampart.Level", 68) }, - {544, sConfigMgr->GetIntDefault("Solocraft.HellfireRaid.Level", 68) }, // Magtheridon's Lair - {545, sConfigMgr->GetIntDefault("Solocraft.CoilfangPumping.Level", 68) }, // The Steamvault - {546, sConfigMgr->GetIntDefault("Solocraft.CoilfangMarsh.Level", 68) }, // The Underbog - {547, sConfigMgr->GetIntDefault("Solocraft.CoilfangDraenei.Level", 68) }, // The Slavepens - {548, sConfigMgr->GetIntDefault("Solocraft.CoilfangRaid.Level", 70) }, // Serpentshrine Cavern - {550, sConfigMgr->GetIntDefault("Solocraft.TempestKeepRaid.Level", 70) }, // The Eye - {552, sConfigMgr->GetIntDefault("Solocraft.TempestKeepArcane.Level", 68) }, // The Arcatraz - {553, sConfigMgr->GetIntDefault("Solocraft.TempestKeepAtrium.Level", 68) }, // The Botanica - {554, sConfigMgr->GetIntDefault("Solocraft.TempestKeepFactory.Level", 68) }, // The Mechanar - {555, sConfigMgr->GetIntDefault("Solocraft.AuchindounShadow.Level", 68) }, // Shadow Labyrinth - {556, sConfigMgr->GetIntDefault("Solocraft.AuchindounDemon.Level", 68) }, // Sethekk Halls - {557, sConfigMgr->GetIntDefault("Solocraft.AuchindounEthereal.Level", 68) }, // Mana-Tombs - {558, sConfigMgr->GetIntDefault("Solocraft.AuchindounDraenei.Level", 68) }, // Auchenai Crypts - {560, sConfigMgr->GetIntDefault("Solocraft.HillsbradPast.Level", 68) }, // Old Hillsbrad Foothills - {564, sConfigMgr->GetIntDefault("Solocraft.BlackTemple.Level", 70) }, - {565, sConfigMgr->GetIntDefault("Solocraft.GruulsLair.Level", 70) }, - {568, sConfigMgr->GetIntDefault("Solocraft.ZulAman.Level", 68) }, - {580, sConfigMgr->GetIntDefault("Solocraft.SunwellPlateau.Level", 70) }, - {585, sConfigMgr->GetIntDefault("Solocraft.Sunwell5ManFix.Level", 68) }, // Magister's Terrace + {269, sConfigMgr->GetOption("Solocraft.CavernsOfTime.Level", 68) }, // The Black Morass + {532, sConfigMgr->GetOption("Solocraft.Karazahn.Level", 68) }, + {534, sConfigMgr->GetOption("Solocraft.HyjalPast.Level", 70) }, // The Battle for Mount Hyjal - Hyjal Summit + {540, sConfigMgr->GetOption("Solocraft.HellfireMilitary.Level", 68) }, // The Shattered Halls + {542, sConfigMgr->GetOption("Solocraft.HellfireDemon.Level", 68) }, // The Blood Furnace + {543, sConfigMgr->GetOption("Solocraft.HellfireRampart.Level", 68) }, + {544, sConfigMgr->GetOption("Solocraft.HellfireRaid.Level", 68) }, // Magtheridon's Lair + {545, sConfigMgr->GetOption("Solocraft.CoilfangPumping.Level", 68) }, // The Steamvault + {546, sConfigMgr->GetOption("Solocraft.CoilfangMarsh.Level", 68) }, // The Underbog + {547, sConfigMgr->GetOption("Solocraft.CoilfangDraenei.Level", 68) }, // The Slavepens + {548, sConfigMgr->GetOption("Solocraft.CoilfangRaid.Level", 70) }, // Serpentshrine Cavern + {550, sConfigMgr->GetOption("Solocraft.TempestKeepRaid.Level", 70) }, // The Eye + {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcane.Level", 68) }, // The Arcatraz + {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtrium.Level", 68) }, // The Botanica + {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactory.Level", 68) }, // The Mechanar + {555, sConfigMgr->GetOption("Solocraft.AuchindounShadow.Level", 68) }, // Shadow Labyrinth + {556, sConfigMgr->GetOption("Solocraft.AuchindounDemon.Level", 68) }, // Sethekk Halls + {557, sConfigMgr->GetOption("Solocraft.AuchindounEthereal.Level", 68) }, // Mana-Tombs + {558, sConfigMgr->GetOption("Solocraft.AuchindounDraenei.Level", 68) }, // Auchenai Crypts + {560, sConfigMgr->GetOption("Solocraft.HillsbradPast.Level", 68) }, // Old Hillsbrad Foothills + {564, sConfigMgr->GetOption("Solocraft.BlackTemple.Level", 70) }, + {565, sConfigMgr->GetOption("Solocraft.GruulsLair.Level", 70) }, + {568, sConfigMgr->GetOption("Solocraft.ZulAman.Level", 68) }, + {580, sConfigMgr->GetOption("Solocraft.SunwellPlateau.Level", 70) }, + {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFix.Level", 68) }, // Magister's Terrace // WOTLK Instances - {533, sConfigMgr->GetIntDefault("Solocraft.StratholmeRaid.Level", 78) }, // Naxxramas - {574, sConfigMgr->GetIntDefault("Solocraft.Valgarde70.Level", 78) }, // Utgarde Keep - {575, sConfigMgr->GetIntDefault("Solocraft.UtgardePinnacle.Level", 78) }, - {576, sConfigMgr->GetIntDefault("Solocraft.Nexus70.Level", 78) }, // The Nexus - {578, sConfigMgr->GetIntDefault("Solocraft.Nexus80.Level", 78) }, // The Occulus - {595, sConfigMgr->GetIntDefault("Solocraft.StratholmeCOT.Level", 78) }, // The Culling of Stratholme - {599, sConfigMgr->GetIntDefault("Solocraft.Ulduar70.Level", 78) }, // Halls of Stone - {600, sConfigMgr->GetIntDefault("Solocraft.DrakTheronKeep.Level", 78) }, // Drak'Tharon Keep - {601, sConfigMgr->GetIntDefault("Solocraft.Azjol_Uppercity.Level", 78) }, // Azjol-Nerub - {602, sConfigMgr->GetIntDefault("Solocraft.Ulduar80.Level", 78) }, // Halls of Lighting - {603, sConfigMgr->GetIntDefault("Solocraft.UlduarRaid.Level", 80) }, // Ulduar - {604, sConfigMgr->GetIntDefault("Solocraft.GunDrak.Level", 78) }, - {608, sConfigMgr->GetIntDefault("Solocraft.DalaranPrison.Level", 78) }, // Violet Hold - {615, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsBlack.Level", 80) }, // The Obsidian Sanctum - {616, sConfigMgr->GetIntDefault("Solocraft.NexusRaid.Level", 80) }, // The Eye of Eternity - {619, sConfigMgr->GetIntDefault("Solocraft.Azjol_LowerCity.Level", 78) }, // Ahn'kahet: The Old Kingdom - {631, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel.Level", 80) }, // Icecrown Citadel - {632, sConfigMgr->GetIntDefault("Solocraft.IcecrownCitadel5Man.Level", 78) }, // The Forge of Souls - {649, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentRaid.Level", 80) }, // Trial of the Crusader - {650, sConfigMgr->GetIntDefault("Solocraft.ArgentTournamentDungeon.Level", 80) }, // Trial of the Champion - {658, sConfigMgr->GetIntDefault("Solocraft.QuarryOfTears.Level", 78) }, // Pit of Saron - {668, sConfigMgr->GetIntDefault("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection - {724, sConfigMgr->GetIntDefault("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum + {533, sConfigMgr->GetOption("Solocraft.StratholmeRaid.Level", 78) }, // Naxxramas + {574, sConfigMgr->GetOption("Solocraft.Valgarde70.Level", 78) }, // Utgarde Keep + {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacle.Level", 78) }, + {576, sConfigMgr->GetOption("Solocraft.Nexus70.Level", 78) }, // The Nexus + {578, sConfigMgr->GetOption("Solocraft.Nexus80.Level", 78) }, // The Occulus + {595, sConfigMgr->GetOption("Solocraft.StratholmeCOT.Level", 78) }, // The Culling of Stratholme + {599, sConfigMgr->GetOption("Solocraft.Ulduar70.Level", 78) }, // Halls of Stone + {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeep.Level", 78) }, // Drak'Tharon Keep + {601, sConfigMgr->GetOption("Solocraft.Azjol_Uppercity.Level", 78) }, // Azjol-Nerub + {602, sConfigMgr->GetOption("Solocraft.Ulduar80.Level", 78) }, // Halls of Lighting + {603, sConfigMgr->GetOption("Solocraft.UlduarRaid.Level", 80) }, // Ulduar + {604, sConfigMgr->GetOption("Solocraft.GunDrak.Level", 78) }, + {608, sConfigMgr->GetOption("Solocraft.DalaranPrison.Level", 78) }, // Violet Hold + {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlack.Level", 80) }, // The Obsidian Sanctum + {616, sConfigMgr->GetOption("Solocraft.NexusRaid.Level", 80) }, // The Eye of Eternity + {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCity.Level", 78) }, // Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadel.Level", 80) }, // Icecrown Citadel + {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5Man.Level", 78) }, // The Forge of Souls + {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaid.Level", 80) }, // Trial of the Crusader + {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeon.Level", 80) }, // Trial of the Champion + {658, sConfigMgr->GetOption("Solocraft.QuarryOfTears.Level", 78) }, // Pit of Saron + {668, sConfigMgr->GetOption("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection + {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum }; // Dungeon Difficulty // Catch alls - D5 = sConfigMgr->GetFloatDefault("Solocraft.Dungeon", 5.0); - D10 = sConfigMgr->GetFloatDefault("Solocraft.Heroic", 10.0); - D25 = sConfigMgr->GetFloatDefault("Solocraft.Raid25", 25.0); - D40 = sConfigMgr->GetFloatDefault("Solocraft.Raid40", 40.0); + D5 = sConfigMgr->GetOption("Solocraft.Dungeon", 5.0); + D10 = sConfigMgr->GetOption("Solocraft.Heroic", 10.0); + D25 = sConfigMgr->GetOption("Solocraft.Raid25", 25.0); + D40 = sConfigMgr->GetOption("Solocraft.Raid40", 40.0); diff_Multiplier = { // WOW Classic Instances - {33, sConfigMgr->GetFloatDefault("Solocraft.ShadowfangKeep", 5.0) }, - {34, sConfigMgr->GetFloatDefault("Solocraft.Stockades", 5.0) }, - {36, sConfigMgr->GetFloatDefault("Solocraft.Deadmines", 5.0) }, - {43, sConfigMgr->GetFloatDefault("Solocraft.WailingCaverns", 5.0) }, - {47, sConfigMgr->GetFloatDefault("Solocraft.RazorfenKraulInstance", 5.0) }, - {48, sConfigMgr->GetFloatDefault("Solocraft.Blackfathom", 5.0) }, - {70, sConfigMgr->GetFloatDefault("Solocraft.Uldaman", 5.0) }, - {90, sConfigMgr->GetFloatDefault("Solocraft.GnomeragonInstance", 5.0) }, - {109, sConfigMgr->GetFloatDefault("Solocraft.SunkenTemple", 5.0) }, - {129, sConfigMgr->GetFloatDefault("Solocraft.RazorfenDowns", 5.0) }, - {189, sConfigMgr->GetFloatDefault("Solocraft.MonasteryInstances", 5.0) }, // Scarlet - {209, sConfigMgr->GetFloatDefault("Solocraft.TanarisInstance", 5.0) }, // Zul'Farrak - {229, sConfigMgr->GetFloatDefault("Solocraft.BlackRockSpire", 10.0) }, - {230, sConfigMgr->GetFloatDefault("Solocraft.BlackrockDepths", 5.0) }, - {249, sConfigMgr->GetFloatDefault("Solocraft.OnyxiaLairInstance", 40.0) }, - {289, sConfigMgr->GetFloatDefault("Solocraft.SchoolofNecromancy", 5.0) }, // Scholo - {309, sConfigMgr->GetFloatDefault("Solocraft.Zul'gurub", 20.0) }, - {329, sConfigMgr->GetFloatDefault("Solocraft.Stratholme", 5.0) }, - {349, sConfigMgr->GetFloatDefault("Solocraft.Mauradon", 5.0) }, - {389, sConfigMgr->GetFloatDefault("Solocraft.OrgrimmarInstance", 5.0) }, // Ragefire - {409, sConfigMgr->GetFloatDefault("Solocraft.MoltenCore", 40.0) }, - {429, sConfigMgr->GetFloatDefault("Solocraft.DireMaul", 5.0) }, - {469, sConfigMgr->GetFloatDefault("Solocraft.BlackwingLair", 40.0) }, - {509, sConfigMgr->GetFloatDefault("Solocraft.AhnQiraj", 20.0) }, - {531, sConfigMgr->GetFloatDefault("Solocraft.AhnQirajTemple", 40.0) }, + {33, sConfigMgr->GetOption("Solocraft.ShadowfangKeep", 5.0) }, + {34, sConfigMgr->GetOption("Solocraft.Stockades", 5.0) }, + {36, sConfigMgr->GetOption("Solocraft.Deadmines", 5.0) }, + {43, sConfigMgr->GetOption("Solocraft.WailingCaverns", 5.0) }, + {47, sConfigMgr->GetOption("Solocraft.RazorfenKraulInstance", 5.0) }, + {48, sConfigMgr->GetOption("Solocraft.Blackfathom", 5.0) }, + {70, sConfigMgr->GetOption("Solocraft.Uldaman", 5.0) }, + {90, sConfigMgr->GetOption("Solocraft.GnomeragonInstance", 5.0) }, + {109, sConfigMgr->GetOption("Solocraft.SunkenTemple", 5.0) }, + {129, sConfigMgr->GetOption("Solocraft.RazorfenDowns", 5.0) }, + {189, sConfigMgr->GetOption("Solocraft.MonasteryInstances", 5.0) }, // Scarlet + {209, sConfigMgr->GetOption("Solocraft.TanarisInstance", 5.0) }, // Zul'Farrak + {229, sConfigMgr->GetOption("Solocraft.BlackRockSpire", 10.0) }, + {230, sConfigMgr->GetOption("Solocraft.BlackrockDepths", 5.0) }, + {249, sConfigMgr->GetOption("Solocraft.OnyxiaLairInstance", 40.0) }, + {289, sConfigMgr->GetOption("Solocraft.SchoolofNecromancy", 5.0) }, // Scholo + {309, sConfigMgr->GetOption("Solocraft.Zul'gurub", 20.0) }, + {329, sConfigMgr->GetOption("Solocraft.Stratholme", 5.0) }, + {349, sConfigMgr->GetOption("Solocraft.Mauradon", 5.0) }, + {389, sConfigMgr->GetOption("Solocraft.OrgrimmarInstance", 5.0) }, // Ragefire + {409, sConfigMgr->GetOption("Solocraft.MoltenCore", 40.0) }, + {429, sConfigMgr->GetOption("Solocraft.DireMaul", 5.0) }, + {469, sConfigMgr->GetOption("Solocraft.BlackwingLair", 40.0) }, + {509, sConfigMgr->GetOption("Solocraft.AhnQiraj", 20.0) }, + {531, sConfigMgr->GetOption("Solocraft.AhnQirajTemple", 40.0) }, // BC Instances - {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTime", 5.0) }, // Black Morass - {532, sConfigMgr->GetFloatDefault("Solocraft.Karazahn", 10.0) }, - {534, sConfigMgr->GetFloatDefault("Solocraft.HyjalPast", 25.0) }, // Mount Hyjal - {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitary", 5.0) }, // The Shattered Halls - {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemon", 5.0) }, // The Blood Furnace - {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampart", 5.0) }, - {544, sConfigMgr->GetFloatDefault("Solocraft.HellfireRaid", 25.0) }, // Magtheridon's Lair - {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumping", 5.0) }, // The Steamvault - {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarsh", 5.0) }, // The Underbog - {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraenei", 5.0) }, // The Slavepens - {548, sConfigMgr->GetFloatDefault("Solocraft.CoilfangRaid", 25.0) }, // Serpentshrine Cavern - {550, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepRaid", 25.0) }, // The Eye - {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcane", 5.0) }, // The Arcatraz - {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtrium", 5.0) }, // The Botanica - {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactory", 5.0) }, // The Mechanar - {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadow", 5.0) }, // Shadow Labyrinth - {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemon", 5.0) }, // Sethekk Halls - {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEthereal", 5.0) }, // Mana-Tombs - {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraenei", 5.0) }, // Auchenai Crypts - {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPast", 5.0) }, // Old Hillsbrad Foothills - {564, sConfigMgr->GetFloatDefault("Solocraft.BlackTemple", 25.0) }, - {565, sConfigMgr->GetFloatDefault("Solocraft.GruulsLair", 25.0) }, - {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAman", 5.0) }, - {580, sConfigMgr->GetFloatDefault("Solocraft.SunwellPlateau", 25.0) }, - {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFix", 5.0) }, // Magister's Terrace + {269, sConfigMgr->GetOption("Solocraft.CavernsOfTime", 5.0) }, // Black Morass + {532, sConfigMgr->GetOption("Solocraft.Karazahn", 10.0) }, + {534, sConfigMgr->GetOption("Solocraft.HyjalPast", 25.0) }, // Mount Hyjal + {540, sConfigMgr->GetOption("Solocraft.HellfireMilitary", 5.0) }, // The Shattered Halls + {542, sConfigMgr->GetOption("Solocraft.HellfireDemon", 5.0) }, // The Blood Furnace + {543, sConfigMgr->GetOption("Solocraft.HellfireRampart", 5.0) }, + {544, sConfigMgr->GetOption("Solocraft.HellfireRaid", 25.0) }, // Magtheridon's Lair + {545, sConfigMgr->GetOption("Solocraft.CoilfangPumping", 5.0) }, // The Steamvault + {546, sConfigMgr->GetOption("Solocraft.CoilfangMarsh", 5.0) }, // The Underbog + {547, sConfigMgr->GetOption("Solocraft.CoilfangDraenei", 5.0) }, // The Slavepens + {548, sConfigMgr->GetOption("Solocraft.CoilfangRaid", 25.0) }, // Serpentshrine Cavern + {550, sConfigMgr->GetOption("Solocraft.TempestKeepRaid", 25.0) }, // The Eye + {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcane", 5.0) }, // The Arcatraz + {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtrium", 5.0) }, // The Botanica + {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactory", 5.0) }, // The Mechanar + {555, sConfigMgr->GetOption("Solocraft.AuchindounShadow", 5.0) }, // Shadow Labyrinth + {556, sConfigMgr->GetOption("Solocraft.AuchindounDemon", 5.0) }, // Sethekk Halls + {557, sConfigMgr->GetOption("Solocraft.AuchindounEthereal", 5.0) }, // Mana-Tombs + {558, sConfigMgr->GetOption("Solocraft.AuchindounDraenei", 5.0) }, // Auchenai Crypts + {560, sConfigMgr->GetOption("Solocraft.HillsbradPast", 5.0) }, // Old Hillsbrad Foothills + {564, sConfigMgr->GetOption("Solocraft.BlackTemple", 25.0) }, + {565, sConfigMgr->GetOption("Solocraft.GruulsLair", 25.0) }, + {568, sConfigMgr->GetOption("Solocraft.ZulAman", 5.0) }, + {580, sConfigMgr->GetOption("Solocraft.SunwellPlateau", 25.0) }, + {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFix", 5.0) }, // Magister's Terrace // WOTLK Instances - {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaid", 10.0) }, // Nax 10 - {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70", 5.0) }, // Utgarde Keep - {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacle", 5.0) }, - {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70", 5.0) }, // The Nexus - {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80", 5.0) }, // The Occulus - {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOT", 5.0) }, // The Culling of Stratholme - {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70", 5.0) }, // Halls of Stone - {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeep", 5.0) }, // Drak'Tharon Keep - {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_Uppercity", 5.0) }, // Azjol-Nerub - {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80", 5.0) }, // Halls of Lighting - {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaid", 10.0) }, // Ulduar 10 - {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrak", 5.0) }, - {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrison", 5.0) }, // Violet Hold - {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlack", 10.0) }, // The Obsidian Sanctum 10 - {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaid", 10.0) }, // The Eye of Eternity 10 - {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCity", 5.0) }, // Ahn'kahet: The Old Kingdom - {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel", 10.0) }, // Icecrown Citadel 10 - {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5Man", 5.0) }, // The Forge of Souls - {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaid", 10.0) }, // Trial of the Crusader 10 - {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeon", 5.0) }, // Trial of the Champion - {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTears", 5.0) }, // Pit of Saron - {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflection", 5.0) }, // Halls of Reflection - {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRed", 10.0) }, // The Ruby Sanctum 10 + {533, sConfigMgr->GetOption("Solocraft.StratholmeRaid", 10.0) }, // Nax 10 + {574, sConfigMgr->GetOption("Solocraft.Valgarde70", 5.0) }, // Utgarde Keep + {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacle", 5.0) }, + {576, sConfigMgr->GetOption("Solocraft.Nexus70", 5.0) }, // The Nexus + {578, sConfigMgr->GetOption("Solocraft.Nexus80", 5.0) }, // The Occulus + {595, sConfigMgr->GetOption("Solocraft.StratholmeCOT", 5.0) }, // The Culling of Stratholme + {599, sConfigMgr->GetOption("Solocraft.Ulduar70", 5.0) }, // Halls of Stone + {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeep", 5.0) }, // Drak'Tharon Keep + {601, sConfigMgr->GetOption("Solocraft.Azjol_Uppercity", 5.0) }, // Azjol-Nerub + {602, sConfigMgr->GetOption("Solocraft.Ulduar80", 5.0) }, // Halls of Lighting + {603, sConfigMgr->GetOption("Solocraft.UlduarRaid", 10.0) }, // Ulduar 10 + {604, sConfigMgr->GetOption("Solocraft.GunDrak", 5.0) }, + {608, sConfigMgr->GetOption("Solocraft.DalaranPrison", 5.0) }, // Violet Hold + {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlack", 10.0) }, // The Obsidian Sanctum 10 + {616, sConfigMgr->GetOption("Solocraft.NexusRaid", 10.0) }, // The Eye of Eternity 10 + {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCity", 5.0) }, // Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadel", 10.0) }, // Icecrown Citadel 10 + {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5Man", 5.0) }, // The Forge of Souls + {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaid", 10.0) }, // Trial of the Crusader 10 + {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeon", 5.0) }, // Trial of the Champion + {658, sConfigMgr->GetOption("Solocraft.QuarryOfTears", 5.0) }, // Pit of Saron + {668, sConfigMgr->GetOption("Solocraft.HallsOfReflection", 5.0) }, // Halls of Reflection + {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed", 10.0) }, // The Ruby Sanctum 10 }; // Heroics diff_Multiplier_Heroics = { // BC Instances Heroics - {269, sConfigMgr->GetFloatDefault("Solocraft.CavernsOfTimeH", 5.0) }, // Black Morass H - {540, sConfigMgr->GetFloatDefault("Solocraft.HellfireMilitaryH", 5.0) }, // The Shattered Halls H - {542, sConfigMgr->GetFloatDefault("Solocraft.HellfireDemonH", 5.0) }, // The Blood Furnace H - {543, sConfigMgr->GetFloatDefault("Solocraft.HellfireRampartH", 5.0) }, // Heroic - {545, sConfigMgr->GetFloatDefault("Solocraft.CoilfangPumpingH", 5.0) }, // The Steamvault - {546, sConfigMgr->GetFloatDefault("Solocraft.CoilfangMarshH", 5.0) }, // The Underbog - {547, sConfigMgr->GetFloatDefault("Solocraft.CoilfangDraeneiH", 5.0) }, // The Slavepens H - {552, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepArcaneH", 5.0) }, // The Arcatraz H - {553, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepAtriumH", 5.0) }, // The Botanica H - {554, sConfigMgr->GetFloatDefault("Solocraft.TempestKeepFactoryH", 5.0) }, // The Mechanar H - {555, sConfigMgr->GetFloatDefault("Solocraft.AuchindounShadowH", 5.0) }, // Shadow Labyrinth H - {556, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDemonH", 5.0) }, // Sethekk Halls H - {557, sConfigMgr->GetFloatDefault("Solocraft.AuchindounEtherealH", 5.0) }, // Mana-Tombs H - {558, sConfigMgr->GetFloatDefault("Solocraft.AuchindounDraeneiH", 5.0) }, // Auchenai Crypts H - {560, sConfigMgr->GetFloatDefault("Solocraft.HillsbradPastH", 5.0) }, // Old Hillsbrad Foothills H - {568, sConfigMgr->GetFloatDefault("Solocraft.ZulAmanH", 5.0) }, // Zul'Aman H - {585, sConfigMgr->GetFloatDefault("Solocraft.Sunwell5ManFixH", 5.0) }, // Magister's Terrace H + {269, sConfigMgr->GetOption("Solocraft.CavernsOfTimeH", 5.0) }, // Black Morass H + {540, sConfigMgr->GetOption("Solocraft.HellfireMilitaryH", 5.0) }, // The Shattered Halls H + {542, sConfigMgr->GetOption("Solocraft.HellfireDemonH", 5.0) }, // The Blood Furnace H + {543, sConfigMgr->GetOption("Solocraft.HellfireRampartH", 5.0) }, // Heroic + {545, sConfigMgr->GetOption("Solocraft.CoilfangPumpingH", 5.0) }, // The Steamvault + {546, sConfigMgr->GetOption("Solocraft.CoilfangMarshH", 5.0) }, // The Underbog + {547, sConfigMgr->GetOption("Solocraft.CoilfangDraeneiH", 5.0) }, // The Slavepens H + {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcaneH", 5.0) }, // The Arcatraz H + {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtriumH", 5.0) }, // The Botanica H + {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactoryH", 5.0) }, // The Mechanar H + {555, sConfigMgr->GetOption("Solocraft.AuchindounShadowH", 5.0) }, // Shadow Labyrinth H + {556, sConfigMgr->GetOption("Solocraft.AuchindounDemonH", 5.0) }, // Sethekk Halls H + {557, sConfigMgr->GetOption("Solocraft.AuchindounEtherealH", 5.0) }, // Mana-Tombs H + {558, sConfigMgr->GetOption("Solocraft.AuchindounDraeneiH", 5.0) }, // Auchenai Crypts H + {560, sConfigMgr->GetOption("Solocraft.HillsbradPastH", 5.0) }, // Old Hillsbrad Foothills H + {568, sConfigMgr->GetOption("Solocraft.ZulAmanH", 5.0) }, // Zul'Aman H + {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFixH", 5.0) }, // Magister's Terrace H // WOTLK Instances Heroics - {533, sConfigMgr->GetFloatDefault("Solocraft.StratholmeRaidH", 25.0) }, // Naxxramas 25 - {574, sConfigMgr->GetFloatDefault("Solocraft.Valgarde70H", 5.0) }, // Utgarde Keep H - {575, sConfigMgr->GetFloatDefault("Solocraft.UtgardePinnacleH", 5.0) }, // Utgarde Pinnacle H - {576, sConfigMgr->GetFloatDefault("Solocraft.Nexus70H", 5.0) }, // The Nexus H - {578, sConfigMgr->GetFloatDefault("Solocraft.Nexus80H", 5.0) }, // The Occulus H - {595, sConfigMgr->GetFloatDefault("Solocraft.StratholmeCOTH", 5.0) }, // The Culling of Stratholme H - {599, sConfigMgr->GetFloatDefault("Solocraft.Ulduar70H", 5.0) }, // Halls of Stone H - {600, sConfigMgr->GetFloatDefault("Solocraft.DrakTheronKeepH", 5.0) }, // Drak'Tharon Keep H - {601, sConfigMgr->GetFloatDefault("Solocraft.Azjol_UppercityH", 5.0) }, // Azjol-Nerub H - {602, sConfigMgr->GetFloatDefault("Solocraft.Ulduar80H", 5.0) }, // Halls of Lighting H - {603, sConfigMgr->GetFloatDefault("Solocraft.UlduarRaidH", 25.0) }, // Ulduar 25 - {604, sConfigMgr->GetFloatDefault("Solocraft.GunDrakH", 5.0) }, // Gundrak H - {608, sConfigMgr->GetFloatDefault("Solocraft.DalaranPrisonH", 5.0) }, // Violet Hold H - {615, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsBlackH", 25.0) }, // The Obsidian Sanctum 25 - {616, sConfigMgr->GetFloatDefault("Solocraft.NexusRaidH", 25.0) }, // The Eye of Eternity 25 - {619, sConfigMgr->GetFloatDefault("Solocraft.Azjol_LowerCityH", 5.0) }, // Ahn'kahet: The Old Kingdom H - {631, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadelH", 25.0) }, // Icecrown Citadel 25 - {632, sConfigMgr->GetFloatDefault("Solocraft.IcecrownCitadel5ManH", 5.0) }, // The Forge of Souls - {649, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH", 25.0) }, // Trial of the Crusader 25 - {650, sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentDungeonH", 5.0) }, // Trial of the Champion H - {658, sConfigMgr->GetFloatDefault("Solocraft.QuarryOfTearsH", 5.0) }, // Pit of Saron H - {668, sConfigMgr->GetFloatDefault("Solocraft.HallsOfReflectionH", 5.0) }, // Halls of Reflection H - {724, sConfigMgr->GetFloatDefault("Solocraft.ChamberOfAspectsRedH", 25.0) }, // The Ruby Sanctum 25 + {533, sConfigMgr->GetOption("Solocraft.StratholmeRaidH", 25.0) }, // Naxxramas 25 + {574, sConfigMgr->GetOption("Solocraft.Valgarde70H", 5.0) }, // Utgarde Keep H + {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacleH", 5.0) }, // Utgarde Pinnacle H + {576, sConfigMgr->GetOption("Solocraft.Nexus70H", 5.0) }, // The Nexus H + {578, sConfigMgr->GetOption("Solocraft.Nexus80H", 5.0) }, // The Occulus H + {595, sConfigMgr->GetOption("Solocraft.StratholmeCOTH", 5.0) }, // The Culling of Stratholme H + {599, sConfigMgr->GetOption("Solocraft.Ulduar70H", 5.0) }, // Halls of Stone H + {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeepH", 5.0) }, // Drak'Tharon Keep H + {601, sConfigMgr->GetOption("Solocraft.Azjol_UppercityH", 5.0) }, // Azjol-Nerub H + {602, sConfigMgr->GetOption("Solocraft.Ulduar80H", 5.0) }, // Halls of Lighting H + {603, sConfigMgr->GetOption("Solocraft.UlduarRaidH", 25.0) }, // Ulduar 25 + {604, sConfigMgr->GetOption("Solocraft.GunDrakH", 5.0) }, // Gundrak H + {608, sConfigMgr->GetOption("Solocraft.DalaranPrisonH", 5.0) }, // Violet Hold H + {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlackH", 25.0) }, // The Obsidian Sanctum 25 + {616, sConfigMgr->GetOption("Solocraft.NexusRaidH", 25.0) }, // The Eye of Eternity 25 + {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCityH", 5.0) }, // Ahn'kahet: The Old Kingdom H + {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadelH", 25.0) }, // Icecrown Citadel 25 + {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5ManH", 5.0) }, // The Forge of Souls + {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH", 25.0) }, // Trial of the Crusader 25 + {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeonH", 5.0) }, // Trial of the Champion H + {658, sConfigMgr->GetOption("Solocraft.QuarryOfTearsH", 5.0) }, // Pit of Saron H + {668, sConfigMgr->GetOption("Solocraft.HallsOfReflectionH", 5.0) }, // Halls of Reflection H + {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRedH", 25.0) }, // The Ruby Sanctum 25 }; //Unique Raids beyond the heroic and normal versions of themselves - D649H10 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic - D649H25 = sConfigMgr->GetFloatDefault("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic + D649H10 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic + D649H25 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic } }; @@ -338,7 +338,7 @@ class solocraft_player_instance_handler : public PlayerScript { solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") {} void OnMapChanged(Player *player) override { - if (sConfigMgr->GetBoolDefault("Solocraft.Enable", true)) + if (sConfigMgr->GetOption("Solocraft.Enable", true)) { Map *map = player->GetMap(); float difficulty = CalculateDifficulty(map, player); From b49de14dde7b38da616c98a35c06f328b51e2a30 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Sat, 5 Feb 2022 17:53:09 -0300 Subject: [PATCH 31/46] Fix: build --- src/Solocraft.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index dfe2687..e9a972f 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -1,4 +1,4 @@ -#include +#include #include "Log.h" #include "Config.h" #include "ScriptMgr.h" @@ -322,11 +322,11 @@ class SolocraftAnnounce : public PlayerScript void OnLogout(Player* player) { //Database query to see if an entry is still there - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); + QueryResult result = CharacterDatabase.Query("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); if (result) { //Remove database entry as the player has logged out - CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); + CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter()); } } }; @@ -471,7 +471,7 @@ class solocraft_player_instance_handler : public PlayerScript { } //Check Database for a current dungeon entry - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); //Modify Player Stats for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h @@ -479,7 +479,7 @@ class solocraft_player_instance_handler : public PlayerScript { //Check for Dungeon to Dungeon Transfer and remove old buff if (result) { - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].GetFloat() * (*result)[4].GetFloat(), false); + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].Get() * (*result)[4].Get(), false); } // Buff the player player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * SoloCraftStatsMult, true); //Unitmods enum UNIT_MOD_STAT_START defined in Unit.h line 391 @@ -499,7 +499,7 @@ class solocraft_player_instance_handler : public PlayerScript { if (result) { // remove spellpower bonus - player->ApplySpellPowerBonus((*result)[3].GetUInt32() * (*result)[4].GetFloat(),false); + player->ApplySpellPowerBonus((*result)[3].Get() * (*result)[4].Get(),false); } //Buff Spellpower @@ -527,7 +527,7 @@ class solocraft_player_instance_handler : public PlayerScript { } // Save Player Dungeon Offsets to Database - CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); + CharacterDatabase.Execute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES ({}, {}, {}, {}, {})", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); } else { @@ -556,13 +556,13 @@ class solocraft_player_instance_handler : public PlayerScript { if (itr->guid != player->GetGUID()) { //Database query to find difficulty for each group member that is currently in an instance - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = %u", itr->guid.GetCounter()); + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = {}", itr->guid.GetCounter()); if (result) { //Test for debuffs already give to other members - They cannot be used to determine the total offset because negative numbers will skew the total difficulty offset - if ((*result)[1].GetFloat() > 0) + if ((*result)[1].Get() > 0) { - GroupDifficulty = GroupDifficulty + (*result)[1].GetFloat(); + GroupDifficulty = GroupDifficulty + (*result)[1].Get(); //sLog->outError("%u : Group member GUID in instance: %u", player->GetGUID(), itr->guid); } } @@ -576,12 +576,12 @@ class solocraft_player_instance_handler : public PlayerScript { { //Database query to get offset from the last instance player exited - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); if (result) { - float difficulty = (*result)[1].GetFloat(); - int SpellPowerBonus = (*result)[3].GetUInt32(); - float StatsMultPct = (*result)[4].GetFloat(); + float difficulty = (*result)[1].Get(); + int SpellPowerBonus = (*result)[3].Get(); + float StatsMultPct = (*result)[4].Get(); //sLog->outError("Map difficulty: %f", difficulty); @@ -603,7 +603,7 @@ class solocraft_player_instance_handler : public PlayerScript { } //Remove database entry as the player is no longer in an instance - CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); + CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter()); } } }; From 95a55d9db80cc1c5680416d3a4563e5d6f1d0c45 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 23 Feb 2022 13:45:51 -0700 Subject: [PATCH 32/46] feat(CORE): XP Balancing and Minor Fix New Feature: XP Balancing Fix: Closes Issue #24 --- conf/Solocraft.conf.dist | 23 ++++- src/Solocraft.cpp | 184 +++++++++++++++++++++++++++++---------- 2 files changed, 159 insertions(+), 48 deletions(-) diff --git a/conf/Solocraft.conf.dist b/conf/Solocraft.conf.dist index dda0ada..3f61c27 100644 --- a/conf/Solocraft.conf.dist +++ b/conf/Solocraft.conf.dist @@ -21,7 +21,8 @@ Solocraft.Announce = 1 ################################################################################################### -# Balancing - Groups (Overloading), Global Spellpower and Stats modifier, Global Class Balancing +# Balancing - Groups (Overloading), Global Spellpower and Stats modifier, Global Class Balancing, +# and XP Gain Balancing ################################################################################################### # Enable Debuff of new party members who enter the dungeon to avoid overloading the dungeon? @@ -75,6 +76,26 @@ SoloCraft.SHAMAN = 100 SoloCraft.WARLOCK = 100 SoloCraft.WARRIOR = 100 + +# XP Gain +# This settings will Enable/Disable XP gained while in the current dungeon + +#Default: 1 (Enabled) +# 0 (Disable) + +Solocraft.XP.Enabled = 1 + + +# XP Balancing (XP Gain must be Enabled) +# This settings will decrease the XP gained based on the Difficulty setting of the dungeon +# and how many players are in the group. + +#Default: 1 (Enabled) +# 0 (Disable) + +Solocraft.XPBal.Enabled = 1 + + ################################################################################################ #Catch all Bucket - Difficulty Offset Defaults ################################################################################################ diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index dfe2687..7f6d6f5 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -1,4 +1,4 @@ -#include +#include #include "Log.h" #include "Config.h" #include "ScriptMgr.h" @@ -15,8 +15,12 @@ bool SoloCraftEnable = 1; bool SoloCraftAnnounceModule = 1; bool SoloCraftDebuffEnable = 1; +bool SolocraftXPBalEnabled = 1; +bool SolocraftXPEnabled = 1; +bool SolocraftNoXPFlag = 0; float SoloCraftSpellMult = 1.0; float SoloCraftStatsMult = 100.0; +float SoloCraftXPMod = 1.0; uint32 SolocraftLevelDiff = 1; uint32 SolocraftDungeonLevel = 1; std::unordered_map classes; @@ -49,7 +53,7 @@ class SolocraftConfig : public WorldScript { SoloCraftEnable = sConfigMgr->GetOption("Solocraft.Enable", 1); SoloCraftAnnounceModule = sConfigMgr->GetOption("Solocraft.Announce", 1); - + //Balancing SoloCraftDebuffEnable = sConfigMgr->GetOption("SoloCraft.Debuff.Enable", 1); SoloCraftSpellMult = sConfigMgr->GetOption("SoloCraft.Spellpower.Mult", 2.5); @@ -67,13 +71,19 @@ class SolocraftConfig : public WorldScript {9, sConfigMgr->GetOption("SoloCraft.WARLOCK", 100) }, {11, sConfigMgr->GetOption("SoloCraft.DRUID", 100) }, }; - + + //XP Enabled + SolocraftXPEnabled = sConfigMgr->GetOption("Solocraft.XP.Enabled", 1); + + //XP Balancing + SolocraftXPBalEnabled = sConfigMgr->GetOption("Solocraft.XPBal.Enabled", 1); + //Level Thresholds SolocraftLevelDiff = sConfigMgr->GetOption("Solocraft.Max.Level.Diff", 10); - + //Catch All Dungeon Level Threshold SolocraftDungeonLevel = sConfigMgr->GetOption("Solocraft.Dungeon.Level", 80); - + // Dungeon Base Level dungeons = { @@ -156,14 +166,14 @@ class SolocraftConfig : public WorldScript {668, sConfigMgr->GetOption("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum }; - + // Dungeon Difficulty // Catch alls D5 = sConfigMgr->GetOption("Solocraft.Dungeon", 5.0); D10 = sConfigMgr->GetOption("Solocraft.Heroic", 10.0); D25 = sConfigMgr->GetOption("Solocraft.Raid25", 25.0); D40 = sConfigMgr->GetOption("Solocraft.Raid40", 40.0); - + diff_Multiplier = { // WOW Classic Instances @@ -246,7 +256,7 @@ class SolocraftConfig : public WorldScript {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed", 10.0) }, // The Ruby Sanctum 10 }; - // Heroics + // Heroics diff_Multiplier_Heroics = { // BC Instances Heroics @@ -297,7 +307,7 @@ class SolocraftConfig : public WorldScript //Unique Raids beyond the heroic and normal versions of themselves D649H10 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic D649H25 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic - + } }; @@ -322,13 +332,21 @@ class SolocraftAnnounce : public PlayerScript void OnLogout(Player* player) { //Database query to see if an entry is still there - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); + QueryResult result = CharacterDatabase.Query("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); if (result) { //Remove database entry as the player has logged out - CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); + CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter()); } } + + void OnGiveXP(Player* p, uint32& amount, Unit* /*victim*/) override + { + if (SolocraftXPBalEnabled) + { + amount = uint32(amount * SoloCraftXPMod); // Decrease Experience based on number of players and difficulty of instance (0 to 100%) + } + } }; class solocraft_player_instance_handler : public PlayerScript { @@ -336,7 +354,7 @@ class solocraft_player_instance_handler : public PlayerScript { public: solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") {} - + void OnMapChanged(Player *player) override { if (sConfigMgr->GetOption("Solocraft.Enable", true)) { @@ -356,7 +374,7 @@ class solocraft_player_instance_handler : public PlayerScript { // Set the instance difficulty int CalculateDifficulty(Map* map, Player* /*player*/) { //float difficulty = 0.0;//changed from 1.0 - + if (map) { //WOTLK 25 Man raids if (map->Is25ManRaid()) @@ -383,7 +401,7 @@ class solocraft_player_instance_handler : public PlayerScript { else return diff_Multiplier_Heroics[map->GetId()]; //return the specific dungeon's level } - + if (diff_Multiplier.find(map->GetId()) == diff_Multiplier.end()) { //Catch Alls ----------------------5 Dungeons and 40 Raids if (map->IsDungeon()) { @@ -395,7 +413,7 @@ class solocraft_player_instance_handler : public PlayerScript { } else return diff_Multiplier[map->GetId()]; //return the specific dungeon's level - } + } return 0; //return 0 } @@ -408,7 +426,7 @@ class solocraft_player_instance_handler : public PlayerScript { else return dungeons[map->GetId()]; //return the specific dungeon's level } - + // Get the group's size int GetNumInGroup(Player* player) { int numInGroup = 1; @@ -443,6 +461,12 @@ class solocraft_player_instance_handler : public PlayerScript { std::ostringstream ss; int SpellPowerBonus = 0; + + //Check for an existing No XP Gain flag - other mod compatibility + if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) + { + SolocraftNoXPFlag = 1; + } if (player->getLevel() <= dunLevel + SolocraftLevelDiff) //If a player is too high level for dungeon don't buff but if in a group will count towards the group offset balancing. { @@ -457,6 +481,12 @@ class solocraft_player_instance_handler : public PlayerScript { difficulty = (-abs(difficulty)) + ((((float)classBalance / 100) * difficulty) / numInGroup); difficulty = roundf(difficulty * 100) / 100; //Float variables suck + //Disable player XP gain if debuff applied + if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && SolocraftXPBalEnabled) + { + player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } + //LOG_INFO("server.loading", "Group Difficulty %f", GroupDifficulty ); //New Logging system } else @@ -466,12 +496,32 @@ class solocraft_player_instance_handler : public PlayerScript { difficulty = (((float)classBalance / 100) * difficulty) / numInGroup; difficulty = roundf(difficulty * 100) / 100; //Float variables suck - two decimal rounding + //Set XP Modifier + SoloCraftXPMod = (1.04 / difficulty) - 0.02; + SoloCraftXPMod = roundf(SoloCraftXPMod * 100) / 100; + + //Check for negative XP modifier - Disable XP Gain + if (SoloCraftXPMod < 0) + { + SoloCraftXPMod = 0; + if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && SolocraftXPBalEnabled) + { + player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } + } + + //Check XP modifier for over max limit and adjust + if (SoloCraftXPMod > 1) + { + SoloCraftXPMod = 1.0; + } + //LOG_INFO("server.loading", "Difficulty %f", difficulty ); //New Logging System } //Check Database for a current dungeon entry - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); //Modify Player Stats for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h @@ -479,18 +529,21 @@ class solocraft_player_instance_handler : public PlayerScript { //Check for Dungeon to Dungeon Transfer and remove old buff if (result) { - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].GetFloat() * (*result)[4].GetFloat(), false); + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].Get() * (*result)[4].Get(), false); } // Buff the player player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * SoloCraftStatsMult, true); //Unitmods enum UNIT_MOD_STAT_START defined in Unit.h line 391 - + } // Set player health player->SetFullHealth();//defined in Unit.h line 1524 + // Set Pet Health + player->CastSpell(player, 6962, true); + //Spellcaster Stat modify - if (player->getPowerType() == POWER_MANA) + if (player->getPowerType() == POWER_MANA || player->getClass() == 11) //Fixes Druid entering dungeon in Bear or Cat form { // Buff the player's mana player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); @@ -499,35 +552,67 @@ class solocraft_player_instance_handler : public PlayerScript { if (result) { // remove spellpower bonus - player->ApplySpellPowerBonus((*result)[3].GetUInt32() * (*result)[4].GetFloat(),false); + player->ApplySpellPowerBonus((*result)[3].Get() * (*result)[4].Get(),false); } //Buff Spellpower if (difficulty > 0) //Debuffed characters do not get spellpower { - SpellPowerBonus = static_cast((player->getLevel() * SoloCraftSpellMult) * difficulty);//Yes, I pulled this calc out of my butt. player->ApplySpellPowerBonus(SpellPowerBonus,true); - //sLog->outError("%u: spellpower Bonus applied: %i", player->GetGUID(), SpellPowerBonus); } } - + + //XP Gain Disabled + if (!SolocraftXPEnabled) + { + SoloCraftXPMod = 0; + if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) + { + player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } + } + //Announcements if (difficulty > 0) { // Announce to player - Buff - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i"; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); + if (!SolocraftXPEnabled) + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Gain: |cffFF0000Disabled"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); + } + else + { + if (!SolocraftXPBalEnabled) + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Balancing: |cffFF0000Disabled"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); + } + else + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Balancing: |cff4CFF00Enabled"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); + } + } } else { // Announce to player - Debuff - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); + if (!SolocraftXPBalEnabled && SolocraftXPEnabled) + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); + } + else + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i and no XP will be awarded. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); + } } - + // Save Player Dungeon Offsets to Database - CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); + CharacterDatabase.Execute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES ({}, {}, {}, {}, {})", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); } else { @@ -542,28 +627,27 @@ class solocraft_player_instance_handler : public PlayerScript { ClearBuffs(player, map); //Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues } } - + // Get the current group members GUIDS and return the total sum of the difficulty offset by all group members currently in the dungeon float GetGroupDifficulty(Player* player) { float GroupDifficulty = 0.0; Group *group = player->GetGroup(); - if (group) + if (group) { Group::MemberSlotList const& groupMembers = group->GetMemberSlots(); for (Group::member_citerator itr = groupMembers.begin(); itr != groupMembers.end(); ++itr) { //Exclude player from the tally because the player is the one entering the dungeon - if (itr->guid != player->GetGUID()) + if (itr->guid != player->GetGUID()) { //Database query to find difficulty for each group member that is currently in an instance - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = %u", itr->guid.GetCounter()); - if (result) + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = {}", itr->guid.GetCounter()); + if (result) { //Test for debuffs already give to other members - They cannot be used to determine the total offset because negative numbers will skew the total difficulty offset - if ((*result)[1].GetFloat() > 0) + if ((*result)[1].Get() > 0) { - GroupDifficulty = GroupDifficulty + (*result)[1].GetFloat(); - //sLog->outError("%u : Group member GUID in instance: %u", player->GetGUID(), itr->guid); + GroupDifficulty = GroupDifficulty + (*result)[1].Get(); } } } @@ -571,19 +655,18 @@ class solocraft_player_instance_handler : public PlayerScript { } return GroupDifficulty; } - + void ClearBuffs(Player* player, Map* map) { - + //Database query to get offset from the last instance player exited - QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter()); + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); if (result) { - float difficulty = (*result)[1].GetFloat(); - int SpellPowerBonus = (*result)[3].GetUInt32(); - float StatsMultPct = (*result)[4].GetFloat(); - - //sLog->outError("Map difficulty: %f", difficulty); + float difficulty = (*result)[1].Get(); + int SpellPowerBonus = (*result)[3].Get(); + float StatsMultPct = (*result)[4].Get(); + SoloCraftXPMod = 1.0; // Inform the player std::ostringstream ss; @@ -601,9 +684,16 @@ class solocraft_player_instance_handler : public PlayerScript { player->ApplySpellPowerBonus(SpellPowerBonus,false); //sLog->outError("%u: spellpower Bonus removed: %i", player->GetGUID(), SpellPowerBonus); } + if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && !SolocraftNoXPFlag) + { + player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } + + //Reinit Existing No XP Gain flag check + SolocraftNoXPFlag = 0; //Remove database entry as the player is no longer in an instance - CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter()); + CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter()); } } }; From 90b58dd96749e0cea2b5160d58bf818b0cdc87d5 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 24 Feb 2022 07:01:12 -0700 Subject: [PATCH 33/46] fix(CORE): Fix Clang issue --- src/Solocraft.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 7f6d6f5..e049394 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -318,7 +318,7 @@ class SolocraftAnnounce : public PlayerScript SolocraftAnnounce() : PlayerScript("SolocraftAnnounce") {} - void OnLogin(Player* player) + void OnLogin(Player* player) override { // Announce Module if (SoloCraftEnable) @@ -642,6 +642,7 @@ class solocraft_player_instance_handler : public PlayerScript { { //Database query to find difficulty for each group member that is currently in an instance QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = {}", itr->guid.GetCounter()); + if (result) { //Test for debuffs already give to other members - They cannot be used to determine the total offset because negative numbers will skew the total difficulty offset @@ -665,6 +666,7 @@ class solocraft_player_instance_handler : public PlayerScript { { float difficulty = (*result)[1].Get(); int SpellPowerBonus = (*result)[3].Get(); + float StatsMultPct = (*result)[4].Get(); SoloCraftXPMod = 1.0; @@ -703,4 +705,4 @@ void AddSolocraftScripts() new SolocraftConfig(); new SolocraftAnnounce(); new solocraft_player_instance_handler(); -} +} \ No newline at end of file From 4c66b8ab54db3c7b88b9e070898b20feb344891b Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 24 Feb 2022 08:06:02 -0700 Subject: [PATCH 34/46] fix(CORE): Another clang issue --- src/Solocraft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index e049394..11644c7 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -329,7 +329,7 @@ class SolocraftAnnounce : public PlayerScript } } } - void OnLogout(Player* player) + void OnLogout(Player* player) override { //Database query to see if an entry is still there QueryResult result = CharacterDatabase.Query("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); From 1b599cf3b8e7d8e8a72eaea832312b2968c66c37 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 24 Feb 2022 10:23:05 -0700 Subject: [PATCH 35/46] fix(CORE): Clang... --- src/Solocraft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 11644c7..32b7734 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -340,7 +340,7 @@ class SolocraftAnnounce : public PlayerScript } } - void OnGiveXP(Player* p, uint32& amount, Unit* /*victim*/) override + void OnGiveXP(Player* /*player*/, uint32& amount, Unit* /*victim*/) override { if (SolocraftXPBalEnabled) { From 65fb531a34025d0bd76f85b6aa1606af29b77384 Mon Sep 17 00:00:00 2001 From: Valoriaz Date: Tue, 24 May 2022 11:35:58 +0200 Subject: [PATCH 36/46] Update Solocraft.sql from tinyint to bigint ( every Character with GUID <255 can scale endless) --- data/sql/db-characters/Solocraft.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/db-characters/Solocraft.sql b/data/sql/db-characters/Solocraft.sql index 3212733..b004298 100644 --- a/data/sql/db-characters/Solocraft.sql +++ b/data/sql/db-characters/Solocraft.sql @@ -1,6 +1,6 @@ -- Structure for table custom_solocraft_character_stats CREATE TABLE IF NOT EXISTS `custom_solocraft_character_stats` ( - `GUID` tinyint unsigned NOT NULL, + `GUID` bigint unsigned NOT NULL, `Difficulty` float NOT NULL, `GroupSize` int NOT NULL, `SpellPower` int unsigned NOT NULL DEFAULT '0', From ee54c1c73e750196812ea1cabe92fc496ead99c8 Mon Sep 17 00:00:00 2001 From: V <44802344+V-Cyberpunk@users.noreply.github.com> Date: Sun, 7 May 2023 16:00:49 +0200 Subject: [PATCH 37/46] Fix for new OnGiveXP --- src/Solocraft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 32b7734..8b2928e 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -340,7 +340,7 @@ class SolocraftAnnounce : public PlayerScript } } - void OnGiveXP(Player* /*player*/, uint32& amount, Unit* /*victim*/) override + void OnGiveXP(Player* /*player*/, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override { if (SolocraftXPBalEnabled) { From 66e2ad267d3f54e9fd2b797dafabad5488f2be18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Sun, 7 May 2023 20:14:12 +0200 Subject: [PATCH 38/46] ci: update pipeline --- .github/workflows/core-build.yml | 43 ++++---------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/.github/workflows/core-build.yml b/.github/workflows/core-build.yml index 24ca5be..921c9eb 100644 --- a/.github/workflows/core-build.yml +++ b/.github/workflows/core-build.yml @@ -1,45 +1,12 @@ name: core-build on: push: + branches: + - 'master' 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/mod-solocraft' - - name: Cache - uses: actions/cache@v1.1.2 - 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 ./apps/ci/ci-install.sh - env: - CONTINUOUS_INTEGRATION: true - - 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 \ No newline at end of file + uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main + with: + module_repo: ${{ github.event.repository.name }} From a1e09e80bd78f1080da17f9f88c42bf05f162fd6 Mon Sep 17 00:00:00 2001 From: KJack Date: Thu, 11 May 2023 20:16:37 -0400 Subject: [PATCH 39/46] CalculateDifficulty should return a float, not an int --- src/Solocraft.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 8b2928e..913ce07 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -372,7 +372,7 @@ class solocraft_player_instance_handler : public PlayerScript { std::map _unitDifficulty; // Set the instance difficulty - int CalculateDifficulty(Map* map, Player* /*player*/) { + float CalculateDifficulty(Map* map, Player* /*player*/) { //float difficulty = 0.0;//changed from 1.0 if (map) { @@ -705,4 +705,4 @@ void AddSolocraftScripts() new SolocraftConfig(); new SolocraftAnnounce(); new solocraft_player_instance_handler(); -} \ No newline at end of file +} From 293dde904f03bfaad7f8a437703be245519c954e Mon Sep 17 00:00:00 2001 From: Walter Pagani Date: Tue, 18 Jul 2023 11:14:51 -0300 Subject: [PATCH 40/46] feat. Update Module and fix. Misc (#40) * feat. Update Module and fix. Misc * fatal error: unused parameter 'map' --- .git_commit_template | 49 - .github/ISSUE_TEMPLATE/bug_report.yml | 72 + .github/ISSUE_TEMPLATE/feature_request.yml | 33 + README.md => .github/README.md | 9 +- .github/workflows/core-build.yml | 3 +- data/.gitkeep | 0 data/sql/.gitkeep | 0 .../{Solocraft.sql => mod_solo_craft.sql} | 4 - pull_request_template.md | 25 + setup_git_commit_template.sh | 4 - src/Solocraft.cpp | 1164 +++++++++-------- 11 files changed, 722 insertions(+), 641 deletions(-) delete mode 100644 .git_commit_template create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml rename README.md => .github/README.md (91%) create mode 100644 data/.gitkeep create mode 100644 data/sql/.gitkeep rename data/sql/db-characters/{Solocraft.sql => mod_solo_craft.sql} (78%) create mode 100644 pull_request_template.md delete mode 100644 setup_git_commit_template.sh diff --git a/.git_commit_template b/.git_commit_template deleted file mode 100644 index 708b551..0000000 --- a/.git_commit_template +++ /dev/null @@ -1,49 +0,0 @@ -### 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. -## ======================================================= diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..5610d2b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,72 @@ +name: Bug report +description: Create a bug report to help us improve. +title: "Bug: " +body: + - type: textarea + id: current + attributes: + label: Current Behaviour + description: | + Description of the problem or issue here. + Include entries of affected creatures / items / quests / spells etc. + If this is a crash, post the crashlog (upload to https://gist.github.com/) and include the link here. + Never upload files! Use GIST for text and YouTube for videos! + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected Behaviour + description: | + Tell us what should happen instead. + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce the problem + description: | + What does someone else need to do to encounter the same bug? + placeholder: | + 1. Step 1 + 2. Step 2 + 3. Step 3 + validations: + required: true + - type: textarea + id: extra + attributes: + label: Extra Notes + description: | + Do you have any extra notes that can help solve the issue that does not fit any other field? + placeholder: | + None + validations: + required: false + - type: textarea + id: commit + attributes: + label: AC rev. hash/commit + description: | + Copy the result of the `.server debug` command (if you need to run it from the client get a prat addon) + validations: + required: true + - type: input + id: os + attributes: + label: Operating system + description: | + The Operating System the Server is running on. + i.e. Windows 11 x64, Debian 10 x64, macOS 12, Ubuntu 20.04 + validations: + required: true + - type: textarea + id: custom + attributes: + label: Custom changes or Modules + description: | + List which custom changes or modules you have applied, i.e. Eluna module, etc. + placeholder: | + None + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..58f79dd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,33 @@ +name: Feature request +description: Suggest an idea for this project +title: "Feature: " +body: + - type: markdown + attributes: + value: | + Thank you for taking your time to fill out a feature request. Remember to fill out all fields including the title above. + An issue that is not properly filled out will be closed. + - type: textarea + id: description + attributes: + label: Describe your feature request or suggestion in detail + description: | + A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe a possible solution to your feature or suggestion in detail + description: | + A clear and concise description of any alternative solutions or features you've considered. + validations: + required: false + - type: textarea + id: additional + attributes: + label: Additional context + description: | + Add any other context or screenshots about the feature request here. + validations: + required: false diff --git a/README.md b/.github/README.md similarity index 91% rename from README.md rename to .github/README.md index 2919a88..d8bf3ff 100644 --- a/README.md +++ b/.github/README.md @@ -1,7 +1,10 @@ # ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore + ## mod-solocraft -- Latest build status with azerothcore: [![Build Status](https://github.com/azerothcore/mod-solocraft/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-solocraft) +- Latest build status with azerothcore: + +[![Build Status](https://github.com/azerothcore/mod-solocraft/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-solocraft) ## Description @@ -23,7 +26,6 @@ - AzerothCore v1.0.1+ - ## Installation ``` @@ -37,13 +39,16 @@ If you need to change the module configuration, go to your server configuration folder (where your worldserver or worldserver.exe is), copy Solocraft.conf.dist to Solocraft.conf and edit that new file. ### Data ### + ------------------------------------------------------------------------------------------------------------------ + - Type: Server/Player - Script: Solocraft - Config: Yes - SQL: Yes ### Credits ### + ------------------------------------------------------------------------------------------------------------------ - [DavidMacalaster](https://github.com/DavidMacalaster/Solocraft) - [Blizzard Entertainment](http://blizzard.com) diff --git a/.github/workflows/core-build.yml b/.github/workflows/core-build.yml index 921c9eb..a178aed 100644 --- a/.github/workflows/core-build.yml +++ b/.github/workflows/core-build.yml @@ -1,9 +1,8 @@ name: core-build on: push: - branches: - - 'master' pull_request: + workflow_dispatch: jobs: build: diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/.gitkeep b/data/sql/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-characters/Solocraft.sql b/data/sql/db-characters/mod_solo_craft.sql similarity index 78% rename from data/sql/db-characters/Solocraft.sql rename to data/sql/db-characters/mod_solo_craft.sql index b004298..70c12e1 100644 --- a/data/sql/db-characters/Solocraft.sql +++ b/data/sql/db-characters/mod_solo_craft.sql @@ -1,4 +1,3 @@ --- Structure for table custom_solocraft_character_stats CREATE TABLE IF NOT EXISTS `custom_solocraft_character_stats` ( `GUID` bigint unsigned NOT NULL, `Difficulty` float NOT NULL, @@ -7,6 +6,3 @@ CREATE TABLE IF NOT EXISTS `custom_solocraft_character_stats` ( `Stats` float NOT NULL DEFAULT '100', PRIMARY KEY (`GUID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; - - --- Data exporting was unselected. \ No newline at end of file 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/setup_git_commit_template.sh b/setup_git_commit_template.sh deleted file mode 100644 index 7b52062..0000000 --- a/setup_git_commit_template.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -## Set a local git commit template -git config --local commit.template ".git_commit_template.txt" ; diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 913ce07..5969cd1 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -54,655 +54,659 @@ class SolocraftConfig : public WorldScript SoloCraftEnable = sConfigMgr->GetOption("Solocraft.Enable", 1); SoloCraftAnnounceModule = sConfigMgr->GetOption("Solocraft.Announce", 1); - //Balancing - SoloCraftDebuffEnable = sConfigMgr->GetOption("SoloCraft.Debuff.Enable", 1); - SoloCraftSpellMult = sConfigMgr->GetOption("SoloCraft.Spellpower.Mult", 2.5); - SoloCraftStatsMult = sConfigMgr->GetOption("SoloCraft.Stats.Mult", 100.0); - classes = - { - {1, sConfigMgr->GetOption("SoloCraft.WARRIOR", 100) }, - {2, sConfigMgr->GetOption("SoloCraft.PALADIN", 100) }, - {3, sConfigMgr->GetOption("SoloCraft.HUNTER", 100) }, - {4, sConfigMgr->GetOption("SoloCraft.ROGUE", 100) }, - {5, sConfigMgr->GetOption("SoloCraft.PRIEST", 100) }, - {6, sConfigMgr->GetOption("SoloCraft.DEATH_KNIGHT", 100) }, - {7, sConfigMgr->GetOption("SoloCraft.SHAMAN", 100) }, - {8, sConfigMgr->GetOption("SoloCraft.MAGE", 100) }, - {9, sConfigMgr->GetOption("SoloCraft.WARLOCK", 100) }, - {11, sConfigMgr->GetOption("SoloCraft.DRUID", 100) }, - }; - - //XP Enabled - SolocraftXPEnabled = sConfigMgr->GetOption("Solocraft.XP.Enabled", 1); - - //XP Balancing - SolocraftXPBalEnabled = sConfigMgr->GetOption("Solocraft.XPBal.Enabled", 1); - - //Level Thresholds - SolocraftLevelDiff = sConfigMgr->GetOption("Solocraft.Max.Level.Diff", 10); - - //Catch All Dungeon Level Threshold - SolocraftDungeonLevel = sConfigMgr->GetOption("Solocraft.Dungeon.Level", 80); - - // Dungeon Base Level - dungeons = - { - // Wow Classic - {33, sConfigMgr->GetOption("Solocraft.ShadowfangKeep.Level", 15) }, - {34, sConfigMgr->GetOption("Solocraft.Stockades.Level", 22) }, - {36, sConfigMgr->GetOption("Solocraft.Deadmines.Level", 18) }, - {43, sConfigMgr->GetOption("Solocraft.WailingCaverns.Level", 17) }, - {47, sConfigMgr->GetOption("Solocraft.RazorfenKraulInstance.Level", 30) }, - {48, sConfigMgr->GetOption("Solocraft.Blackfathom.Level", 20) }, - {70, sConfigMgr->GetOption("Solocraft.Uldaman.Level", 40) }, - {90, sConfigMgr->GetOption("Solocraft.GnomeragonInstance.Level", 24) }, - {109, sConfigMgr->GetOption("Solocraft.SunkenTemple.Level", 50) }, - {129, sConfigMgr->GetOption("Solocraft.RazorfenDowns.Level", 40) }, - {189, sConfigMgr->GetOption("Solocraft.MonasteryInstances.Level", 35) }, // Scarlet Monastery - {209, sConfigMgr->GetOption("Solocraft.TanarisInstance.Level", 44) }, // Zul'Farrak - {229, sConfigMgr->GetOption("Solocraft.BlackRockSpire.Level", 55) }, - {230, sConfigMgr->GetOption("Solocraft.BlackrockDepths.Level", 50) }, - {249, sConfigMgr->GetOption("Solocraft.OnyxiaLairInstance.Level", 60) }, - {289, sConfigMgr->GetOption("Solocraft.SchoolofNecromancy.Level", 55) }, // Scholomance - {309, sConfigMgr->GetOption("Solocraft.Zul'gurub.Level", 60) }, - {329, sConfigMgr->GetOption("Solocraft.Stratholme.Level", 55) }, - {349, sConfigMgr->GetOption("Solocraft.Mauradon.Level", 48) }, - {389, sConfigMgr->GetOption("Solocraft.OrgrimmarInstance.Level", 15) }, // Ragefire Chasm - {409, sConfigMgr->GetOption("Solocraft.MoltenCore.Level", 60) }, - {429, sConfigMgr->GetOption("Solocraft.DireMaul.Level", 48) }, - {469, sConfigMgr->GetOption("Solocraft.BlackwingLair.Level", 40) }, - {509, sConfigMgr->GetOption("Solocraft.AhnQiraj.Level", 60) }, // Ruins of Ahn'Qiraj - {531, sConfigMgr->GetOption("Solocraft.AhnQirajTemple.Level", 60) }, - - // BC Instances - {269, sConfigMgr->GetOption("Solocraft.CavernsOfTime.Level", 68) }, // The Black Morass - {532, sConfigMgr->GetOption("Solocraft.Karazahn.Level", 68) }, - {534, sConfigMgr->GetOption("Solocraft.HyjalPast.Level", 70) }, // The Battle for Mount Hyjal - Hyjal Summit - {540, sConfigMgr->GetOption("Solocraft.HellfireMilitary.Level", 68) }, // The Shattered Halls - {542, sConfigMgr->GetOption("Solocraft.HellfireDemon.Level", 68) }, // The Blood Furnace - {543, sConfigMgr->GetOption("Solocraft.HellfireRampart.Level", 68) }, - {544, sConfigMgr->GetOption("Solocraft.HellfireRaid.Level", 68) }, // Magtheridon's Lair - {545, sConfigMgr->GetOption("Solocraft.CoilfangPumping.Level", 68) }, // The Steamvault - {546, sConfigMgr->GetOption("Solocraft.CoilfangMarsh.Level", 68) }, // The Underbog - {547, sConfigMgr->GetOption("Solocraft.CoilfangDraenei.Level", 68) }, // The Slavepens - {548, sConfigMgr->GetOption("Solocraft.CoilfangRaid.Level", 70) }, // Serpentshrine Cavern - {550, sConfigMgr->GetOption("Solocraft.TempestKeepRaid.Level", 70) }, // The Eye - {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcane.Level", 68) }, // The Arcatraz - {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtrium.Level", 68) }, // The Botanica - {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactory.Level", 68) }, // The Mechanar - {555, sConfigMgr->GetOption("Solocraft.AuchindounShadow.Level", 68) }, // Shadow Labyrinth - {556, sConfigMgr->GetOption("Solocraft.AuchindounDemon.Level", 68) }, // Sethekk Halls - {557, sConfigMgr->GetOption("Solocraft.AuchindounEthereal.Level", 68) }, // Mana-Tombs - {558, sConfigMgr->GetOption("Solocraft.AuchindounDraenei.Level", 68) }, // Auchenai Crypts - {560, sConfigMgr->GetOption("Solocraft.HillsbradPast.Level", 68) }, // Old Hillsbrad Foothills - {564, sConfigMgr->GetOption("Solocraft.BlackTemple.Level", 70) }, - {565, sConfigMgr->GetOption("Solocraft.GruulsLair.Level", 70) }, - {568, sConfigMgr->GetOption("Solocraft.ZulAman.Level", 68) }, - {580, sConfigMgr->GetOption("Solocraft.SunwellPlateau.Level", 70) }, - {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFix.Level", 68) }, // Magister's Terrace - - // WOTLK Instances - {533, sConfigMgr->GetOption("Solocraft.StratholmeRaid.Level", 78) }, // Naxxramas - {574, sConfigMgr->GetOption("Solocraft.Valgarde70.Level", 78) }, // Utgarde Keep - {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacle.Level", 78) }, - {576, sConfigMgr->GetOption("Solocraft.Nexus70.Level", 78) }, // The Nexus - {578, sConfigMgr->GetOption("Solocraft.Nexus80.Level", 78) }, // The Occulus - {595, sConfigMgr->GetOption("Solocraft.StratholmeCOT.Level", 78) }, // The Culling of Stratholme - {599, sConfigMgr->GetOption("Solocraft.Ulduar70.Level", 78) }, // Halls of Stone - {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeep.Level", 78) }, // Drak'Tharon Keep - {601, sConfigMgr->GetOption("Solocraft.Azjol_Uppercity.Level", 78) }, // Azjol-Nerub - {602, sConfigMgr->GetOption("Solocraft.Ulduar80.Level", 78) }, // Halls of Lighting - {603, sConfigMgr->GetOption("Solocraft.UlduarRaid.Level", 80) }, // Ulduar - {604, sConfigMgr->GetOption("Solocraft.GunDrak.Level", 78) }, - {608, sConfigMgr->GetOption("Solocraft.DalaranPrison.Level", 78) }, // Violet Hold - {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlack.Level", 80) }, // The Obsidian Sanctum - {616, sConfigMgr->GetOption("Solocraft.NexusRaid.Level", 80) }, // The Eye of Eternity - {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCity.Level", 78) }, // Ahn'kahet: The Old Kingdom - {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadel.Level", 80) }, // Icecrown Citadel - {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5Man.Level", 78) }, // The Forge of Souls - {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaid.Level", 80) }, // Trial of the Crusader - {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeon.Level", 80) }, // Trial of the Champion - {658, sConfigMgr->GetOption("Solocraft.QuarryOfTears.Level", 78) }, // Pit of Saron - {668, sConfigMgr->GetOption("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection - {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum - }; - - // Dungeon Difficulty - // Catch alls + //Balancing + SoloCraftDebuffEnable = sConfigMgr->GetOption("SoloCraft.Debuff.Enable", 1); + SoloCraftSpellMult = sConfigMgr->GetOption("SoloCraft.Spellpower.Mult", 2.5); + SoloCraftStatsMult = sConfigMgr->GetOption("SoloCraft.Stats.Mult", 100.0); + classes = + { + {1, sConfigMgr->GetOption("SoloCraft.WARRIOR", 100) }, + {2, sConfigMgr->GetOption("SoloCraft.PALADIN", 100) }, + {3, sConfigMgr->GetOption("SoloCraft.HUNTER", 100) }, + {4, sConfigMgr->GetOption("SoloCraft.ROGUE", 100) }, + {5, sConfigMgr->GetOption("SoloCraft.PRIEST", 100) }, + {6, sConfigMgr->GetOption("SoloCraft.DEATH_KNIGHT", 100) }, + {7, sConfigMgr->GetOption("SoloCraft.SHAMAN", 100) }, + {8, sConfigMgr->GetOption("SoloCraft.MAGE", 100) }, + {9, sConfigMgr->GetOption("SoloCraft.WARLOCK", 100) }, + {11, sConfigMgr->GetOption("SoloCraft.DRUID", 100) }, + }; + + //XP Enabled + SolocraftXPEnabled = sConfigMgr->GetOption("Solocraft.XP.Enabled", 1); + + //XP Balancing + SolocraftXPBalEnabled = sConfigMgr->GetOption("Solocraft.XPBal.Enabled", 1); + + //Level Thresholds + SolocraftLevelDiff = sConfigMgr->GetOption("Solocraft.Max.Level.Diff", 10); + + //Catch All Dungeon Level Threshold + SolocraftDungeonLevel = sConfigMgr->GetOption("Solocraft.Dungeon.Level", 80); + + // Dungeon Base Level + dungeons = + { + // Wow Classic + {33, sConfigMgr->GetOption("Solocraft.ShadowfangKeep.Level", 15) }, + {34, sConfigMgr->GetOption("Solocraft.Stockades.Level", 22) }, + {36, sConfigMgr->GetOption("Solocraft.Deadmines.Level", 18) }, + {43, sConfigMgr->GetOption("Solocraft.WailingCaverns.Level", 17) }, + {47, sConfigMgr->GetOption("Solocraft.RazorfenKraulInstance.Level", 30) }, + {48, sConfigMgr->GetOption("Solocraft.Blackfathom.Level", 20) }, + {70, sConfigMgr->GetOption("Solocraft.Uldaman.Level", 40) }, + {90, sConfigMgr->GetOption("Solocraft.GnomeragonInstance.Level", 24) }, + {109, sConfigMgr->GetOption("Solocraft.SunkenTemple.Level", 50) }, + {129, sConfigMgr->GetOption("Solocraft.RazorfenDowns.Level", 40) }, + {189, sConfigMgr->GetOption("Solocraft.MonasteryInstances.Level", 35) }, // Scarlet Monastery + {209, sConfigMgr->GetOption("Solocraft.TanarisInstance.Level", 44) }, // Zul'Farrak + {229, sConfigMgr->GetOption("Solocraft.BlackRockSpire.Level", 55) }, + {230, sConfigMgr->GetOption("Solocraft.BlackrockDepths.Level", 50) }, + {249, sConfigMgr->GetOption("Solocraft.OnyxiaLairInstance.Level", 60) }, + {289, sConfigMgr->GetOption("Solocraft.SchoolofNecromancy.Level", 55) }, // Scholomance + {309, sConfigMgr->GetOption("Solocraft.Zul'gurub.Level", 60) }, + {329, sConfigMgr->GetOption("Solocraft.Stratholme.Level", 55) }, + {349, sConfigMgr->GetOption("Solocraft.Mauradon.Level", 48) }, + {389, sConfigMgr->GetOption("Solocraft.OrgrimmarInstance.Level", 15) }, // Ragefire Chasm + {409, sConfigMgr->GetOption("Solocraft.MoltenCore.Level", 60) }, + {429, sConfigMgr->GetOption("Solocraft.DireMaul.Level", 48) }, + {469, sConfigMgr->GetOption("Solocraft.BlackwingLair.Level", 40) }, + {509, sConfigMgr->GetOption("Solocraft.AhnQiraj.Level", 60) }, // Ruins of Ahn'Qiraj + {531, sConfigMgr->GetOption("Solocraft.AhnQirajTemple.Level", 60) }, + + // BC Instances + {269, sConfigMgr->GetOption("Solocraft.CavernsOfTime.Level", 68) }, // The Black Morass + {532, sConfigMgr->GetOption("Solocraft.Karazahn.Level", 68) }, + {534, sConfigMgr->GetOption("Solocraft.HyjalPast.Level", 70) }, // The Battle for Mount Hyjal - Hyjal Summit + {540, sConfigMgr->GetOption("Solocraft.HellfireMilitary.Level", 68) }, // The Shattered Halls + {542, sConfigMgr->GetOption("Solocraft.HellfireDemon.Level", 68) }, // The Blood Furnace + {543, sConfigMgr->GetOption("Solocraft.HellfireRampart.Level", 68) }, + {544, sConfigMgr->GetOption("Solocraft.HellfireRaid.Level", 68) }, // Magtheridon's Lair + {545, sConfigMgr->GetOption("Solocraft.CoilfangPumping.Level", 68) }, // The Steamvault + {546, sConfigMgr->GetOption("Solocraft.CoilfangMarsh.Level", 68) }, // The Underbog + {547, sConfigMgr->GetOption("Solocraft.CoilfangDraenei.Level", 68) }, // The Slavepens + {548, sConfigMgr->GetOption("Solocraft.CoilfangRaid.Level", 70) }, // Serpentshrine Cavern + {550, sConfigMgr->GetOption("Solocraft.TempestKeepRaid.Level", 70) }, // The Eye + {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcane.Level", 68) }, // The Arcatraz + {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtrium.Level", 68) }, // The Botanica + {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactory.Level", 68) }, // The Mechanar + {555, sConfigMgr->GetOption("Solocraft.AuchindounShadow.Level", 68) }, // Shadow Labyrinth + {556, sConfigMgr->GetOption("Solocraft.AuchindounDemon.Level", 68) }, // Sethekk Halls + {557, sConfigMgr->GetOption("Solocraft.AuchindounEthereal.Level", 68) }, // Mana-Tombs + {558, sConfigMgr->GetOption("Solocraft.AuchindounDraenei.Level", 68) }, // Auchenai Crypts + {560, sConfigMgr->GetOption("Solocraft.HillsbradPast.Level", 68) }, // Old Hillsbrad Foothills + {564, sConfigMgr->GetOption("Solocraft.BlackTemple.Level", 70) }, + {565, sConfigMgr->GetOption("Solocraft.GruulsLair.Level", 70) }, + {568, sConfigMgr->GetOption("Solocraft.ZulAman.Level", 68) }, + {580, sConfigMgr->GetOption("Solocraft.SunwellPlateau.Level", 70) }, + {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFix.Level", 68) }, // Magister's Terrace + + // WOTLK Instances + {533, sConfigMgr->GetOption("Solocraft.StratholmeRaid.Level", 78) }, // Naxxramas + {574, sConfigMgr->GetOption("Solocraft.Valgarde70.Level", 78) }, // Utgarde Keep + {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacle.Level", 78) }, + {576, sConfigMgr->GetOption("Solocraft.Nexus70.Level", 78) }, // The Nexus + {578, sConfigMgr->GetOption("Solocraft.Nexus80.Level", 78) }, // The Occulus + {595, sConfigMgr->GetOption("Solocraft.StratholmeCOT.Level", 78) }, // The Culling of Stratholme + {599, sConfigMgr->GetOption("Solocraft.Ulduar70.Level", 78) }, // Halls of Stone + {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeep.Level", 78) }, // Drak'Tharon Keep + {601, sConfigMgr->GetOption("Solocraft.Azjol_Uppercity.Level", 78) }, // Azjol-Nerub + {602, sConfigMgr->GetOption("Solocraft.Ulduar80.Level", 78) }, // Halls of Lighting + {603, sConfigMgr->GetOption("Solocraft.UlduarRaid.Level", 80) }, // Ulduar + {604, sConfigMgr->GetOption("Solocraft.GunDrak.Level", 78) }, + {608, sConfigMgr->GetOption("Solocraft.DalaranPrison.Level", 78) }, // Violet Hold + {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlack.Level", 80) }, // The Obsidian Sanctum + {616, sConfigMgr->GetOption("Solocraft.NexusRaid.Level", 80) }, // The Eye of Eternity + {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCity.Level", 78) }, // Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadel.Level", 80) }, // Icecrown Citadel + {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5Man.Level", 78) }, // The Forge of Souls + {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaid.Level", 80) }, // Trial of the Crusader + {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeon.Level", 80) }, // Trial of the Champion + {658, sConfigMgr->GetOption("Solocraft.QuarryOfTears.Level", 78) }, // Pit of Saron + {668, sConfigMgr->GetOption("Solocraft.HallsOfReflection.Level", 78) }, // Halls of Reflection + {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed.Level", 80) }, // The Ruby Sanctum + }; + + // Dungeon Difficulty | Catch alls D5 = sConfigMgr->GetOption("Solocraft.Dungeon", 5.0); D10 = sConfigMgr->GetOption("Solocraft.Heroic", 10.0); D25 = sConfigMgr->GetOption("Solocraft.Raid25", 25.0); D40 = sConfigMgr->GetOption("Solocraft.Raid40", 40.0); - diff_Multiplier = - { - // WOW Classic Instances - {33, sConfigMgr->GetOption("Solocraft.ShadowfangKeep", 5.0) }, - {34, sConfigMgr->GetOption("Solocraft.Stockades", 5.0) }, - {36, sConfigMgr->GetOption("Solocraft.Deadmines", 5.0) }, - {43, sConfigMgr->GetOption("Solocraft.WailingCaverns", 5.0) }, - {47, sConfigMgr->GetOption("Solocraft.RazorfenKraulInstance", 5.0) }, - {48, sConfigMgr->GetOption("Solocraft.Blackfathom", 5.0) }, - {70, sConfigMgr->GetOption("Solocraft.Uldaman", 5.0) }, - {90, sConfigMgr->GetOption("Solocraft.GnomeragonInstance", 5.0) }, - {109, sConfigMgr->GetOption("Solocraft.SunkenTemple", 5.0) }, - {129, sConfigMgr->GetOption("Solocraft.RazorfenDowns", 5.0) }, - {189, sConfigMgr->GetOption("Solocraft.MonasteryInstances", 5.0) }, // Scarlet - {209, sConfigMgr->GetOption("Solocraft.TanarisInstance", 5.0) }, // Zul'Farrak - {229, sConfigMgr->GetOption("Solocraft.BlackRockSpire", 10.0) }, - {230, sConfigMgr->GetOption("Solocraft.BlackrockDepths", 5.0) }, - {249, sConfigMgr->GetOption("Solocraft.OnyxiaLairInstance", 40.0) }, - {289, sConfigMgr->GetOption("Solocraft.SchoolofNecromancy", 5.0) }, // Scholo - {309, sConfigMgr->GetOption("Solocraft.Zul'gurub", 20.0) }, - {329, sConfigMgr->GetOption("Solocraft.Stratholme", 5.0) }, - {349, sConfigMgr->GetOption("Solocraft.Mauradon", 5.0) }, - {389, sConfigMgr->GetOption("Solocraft.OrgrimmarInstance", 5.0) }, // Ragefire - {409, sConfigMgr->GetOption("Solocraft.MoltenCore", 40.0) }, - {429, sConfigMgr->GetOption("Solocraft.DireMaul", 5.0) }, - {469, sConfigMgr->GetOption("Solocraft.BlackwingLair", 40.0) }, - {509, sConfigMgr->GetOption("Solocraft.AhnQiraj", 20.0) }, - {531, sConfigMgr->GetOption("Solocraft.AhnQirajTemple", 40.0) }, - - // BC Instances - {269, sConfigMgr->GetOption("Solocraft.CavernsOfTime", 5.0) }, // Black Morass - {532, sConfigMgr->GetOption("Solocraft.Karazahn", 10.0) }, - {534, sConfigMgr->GetOption("Solocraft.HyjalPast", 25.0) }, // Mount Hyjal - {540, sConfigMgr->GetOption("Solocraft.HellfireMilitary", 5.0) }, // The Shattered Halls - {542, sConfigMgr->GetOption("Solocraft.HellfireDemon", 5.0) }, // The Blood Furnace - {543, sConfigMgr->GetOption("Solocraft.HellfireRampart", 5.0) }, - {544, sConfigMgr->GetOption("Solocraft.HellfireRaid", 25.0) }, // Magtheridon's Lair - {545, sConfigMgr->GetOption("Solocraft.CoilfangPumping", 5.0) }, // The Steamvault - {546, sConfigMgr->GetOption("Solocraft.CoilfangMarsh", 5.0) }, // The Underbog - {547, sConfigMgr->GetOption("Solocraft.CoilfangDraenei", 5.0) }, // The Slavepens - {548, sConfigMgr->GetOption("Solocraft.CoilfangRaid", 25.0) }, // Serpentshrine Cavern - {550, sConfigMgr->GetOption("Solocraft.TempestKeepRaid", 25.0) }, // The Eye - {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcane", 5.0) }, // The Arcatraz - {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtrium", 5.0) }, // The Botanica - {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactory", 5.0) }, // The Mechanar - {555, sConfigMgr->GetOption("Solocraft.AuchindounShadow", 5.0) }, // Shadow Labyrinth - {556, sConfigMgr->GetOption("Solocraft.AuchindounDemon", 5.0) }, // Sethekk Halls - {557, sConfigMgr->GetOption("Solocraft.AuchindounEthereal", 5.0) }, // Mana-Tombs - {558, sConfigMgr->GetOption("Solocraft.AuchindounDraenei", 5.0) }, // Auchenai Crypts - {560, sConfigMgr->GetOption("Solocraft.HillsbradPast", 5.0) }, // Old Hillsbrad Foothills - {564, sConfigMgr->GetOption("Solocraft.BlackTemple", 25.0) }, - {565, sConfigMgr->GetOption("Solocraft.GruulsLair", 25.0) }, - {568, sConfigMgr->GetOption("Solocraft.ZulAman", 5.0) }, - {580, sConfigMgr->GetOption("Solocraft.SunwellPlateau", 25.0) }, - {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFix", 5.0) }, // Magister's Terrace - - // WOTLK Instances - {533, sConfigMgr->GetOption("Solocraft.StratholmeRaid", 10.0) }, // Nax 10 - {574, sConfigMgr->GetOption("Solocraft.Valgarde70", 5.0) }, // Utgarde Keep - {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacle", 5.0) }, - {576, sConfigMgr->GetOption("Solocraft.Nexus70", 5.0) }, // The Nexus - {578, sConfigMgr->GetOption("Solocraft.Nexus80", 5.0) }, // The Occulus - {595, sConfigMgr->GetOption("Solocraft.StratholmeCOT", 5.0) }, // The Culling of Stratholme - {599, sConfigMgr->GetOption("Solocraft.Ulduar70", 5.0) }, // Halls of Stone - {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeep", 5.0) }, // Drak'Tharon Keep - {601, sConfigMgr->GetOption("Solocraft.Azjol_Uppercity", 5.0) }, // Azjol-Nerub - {602, sConfigMgr->GetOption("Solocraft.Ulduar80", 5.0) }, // Halls of Lighting - {603, sConfigMgr->GetOption("Solocraft.UlduarRaid", 10.0) }, // Ulduar 10 - {604, sConfigMgr->GetOption("Solocraft.GunDrak", 5.0) }, - {608, sConfigMgr->GetOption("Solocraft.DalaranPrison", 5.0) }, // Violet Hold - {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlack", 10.0) }, // The Obsidian Sanctum 10 - {616, sConfigMgr->GetOption("Solocraft.NexusRaid", 10.0) }, // The Eye of Eternity 10 - {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCity", 5.0) }, // Ahn'kahet: The Old Kingdom - {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadel", 10.0) }, // Icecrown Citadel 10 - {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5Man", 5.0) }, // The Forge of Souls - {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaid", 10.0) }, // Trial of the Crusader 10 - {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeon", 5.0) }, // Trial of the Champion - {658, sConfigMgr->GetOption("Solocraft.QuarryOfTears", 5.0) }, // Pit of Saron - {668, sConfigMgr->GetOption("Solocraft.HallsOfReflection", 5.0) }, // Halls of Reflection - {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed", 10.0) }, // The Ruby Sanctum 10 - }; - - // Heroics - diff_Multiplier_Heroics = - { - // BC Instances Heroics - {269, sConfigMgr->GetOption("Solocraft.CavernsOfTimeH", 5.0) }, // Black Morass H - {540, sConfigMgr->GetOption("Solocraft.HellfireMilitaryH", 5.0) }, // The Shattered Halls H - {542, sConfigMgr->GetOption("Solocraft.HellfireDemonH", 5.0) }, // The Blood Furnace H - {543, sConfigMgr->GetOption("Solocraft.HellfireRampartH", 5.0) }, // Heroic - {545, sConfigMgr->GetOption("Solocraft.CoilfangPumpingH", 5.0) }, // The Steamvault - {546, sConfigMgr->GetOption("Solocraft.CoilfangMarshH", 5.0) }, // The Underbog - {547, sConfigMgr->GetOption("Solocraft.CoilfangDraeneiH", 5.0) }, // The Slavepens H - {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcaneH", 5.0) }, // The Arcatraz H - {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtriumH", 5.0) }, // The Botanica H - {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactoryH", 5.0) }, // The Mechanar H - {555, sConfigMgr->GetOption("Solocraft.AuchindounShadowH", 5.0) }, // Shadow Labyrinth H - {556, sConfigMgr->GetOption("Solocraft.AuchindounDemonH", 5.0) }, // Sethekk Halls H - {557, sConfigMgr->GetOption("Solocraft.AuchindounEtherealH", 5.0) }, // Mana-Tombs H - {558, sConfigMgr->GetOption("Solocraft.AuchindounDraeneiH", 5.0) }, // Auchenai Crypts H - {560, sConfigMgr->GetOption("Solocraft.HillsbradPastH", 5.0) }, // Old Hillsbrad Foothills H - {568, sConfigMgr->GetOption("Solocraft.ZulAmanH", 5.0) }, // Zul'Aman H - {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFixH", 5.0) }, // Magister's Terrace H - - // WOTLK Instances Heroics - {533, sConfigMgr->GetOption("Solocraft.StratholmeRaidH", 25.0) }, // Naxxramas 25 - {574, sConfigMgr->GetOption("Solocraft.Valgarde70H", 5.0) }, // Utgarde Keep H - {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacleH", 5.0) }, // Utgarde Pinnacle H - {576, sConfigMgr->GetOption("Solocraft.Nexus70H", 5.0) }, // The Nexus H - {578, sConfigMgr->GetOption("Solocraft.Nexus80H", 5.0) }, // The Occulus H - {595, sConfigMgr->GetOption("Solocraft.StratholmeCOTH", 5.0) }, // The Culling of Stratholme H - {599, sConfigMgr->GetOption("Solocraft.Ulduar70H", 5.0) }, // Halls of Stone H - {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeepH", 5.0) }, // Drak'Tharon Keep H - {601, sConfigMgr->GetOption("Solocraft.Azjol_UppercityH", 5.0) }, // Azjol-Nerub H - {602, sConfigMgr->GetOption("Solocraft.Ulduar80H", 5.0) }, // Halls of Lighting H - {603, sConfigMgr->GetOption("Solocraft.UlduarRaidH", 25.0) }, // Ulduar 25 - {604, sConfigMgr->GetOption("Solocraft.GunDrakH", 5.0) }, // Gundrak H - {608, sConfigMgr->GetOption("Solocraft.DalaranPrisonH", 5.0) }, // Violet Hold H - {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlackH", 25.0) }, // The Obsidian Sanctum 25 - {616, sConfigMgr->GetOption("Solocraft.NexusRaidH", 25.0) }, // The Eye of Eternity 25 - {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCityH", 5.0) }, // Ahn'kahet: The Old Kingdom H - {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadelH", 25.0) }, // Icecrown Citadel 25 - {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5ManH", 5.0) }, // The Forge of Souls - {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH", 25.0) }, // Trial of the Crusader 25 - {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeonH", 5.0) }, // Trial of the Champion H - {658, sConfigMgr->GetOption("Solocraft.QuarryOfTearsH", 5.0) }, // Pit of Saron H - {668, sConfigMgr->GetOption("Solocraft.HallsOfReflectionH", 5.0) }, // Halls of Reflection H - {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRedH", 25.0) }, // The Ruby Sanctum 25 - }; - - //Unique Raids beyond the heroic and normal versions of themselves - D649H10 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic - D649H25 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic - + diff_Multiplier = + { + // WOW Classic Instances + {33, sConfigMgr->GetOption("Solocraft.ShadowfangKeep", 5.0) }, + {34, sConfigMgr->GetOption("Solocraft.Stockades", 5.0) }, + {36, sConfigMgr->GetOption("Solocraft.Deadmines", 5.0) }, + {43, sConfigMgr->GetOption("Solocraft.WailingCaverns", 5.0) }, + {47, sConfigMgr->GetOption("Solocraft.RazorfenKraulInstance", 5.0) }, + {48, sConfigMgr->GetOption("Solocraft.Blackfathom", 5.0) }, + {70, sConfigMgr->GetOption("Solocraft.Uldaman", 5.0) }, + {90, sConfigMgr->GetOption("Solocraft.GnomeragonInstance", 5.0) }, + {109, sConfigMgr->GetOption("Solocraft.SunkenTemple", 5.0) }, + {129, sConfigMgr->GetOption("Solocraft.RazorfenDowns", 5.0) }, + {189, sConfigMgr->GetOption("Solocraft.MonasteryInstances", 5.0) }, // Scarlet + {209, sConfigMgr->GetOption("Solocraft.TanarisInstance", 5.0) }, // Zul'Farrak + {229, sConfigMgr->GetOption("Solocraft.BlackRockSpire", 10.0) }, + {230, sConfigMgr->GetOption("Solocraft.BlackrockDepths", 5.0) }, + {249, sConfigMgr->GetOption("Solocraft.OnyxiaLairInstance", 40.0) }, + {289, sConfigMgr->GetOption("Solocraft.SchoolofNecromancy", 5.0) }, // Scholo + {309, sConfigMgr->GetOption("Solocraft.Zul'gurub", 20.0) }, + {329, sConfigMgr->GetOption("Solocraft.Stratholme", 5.0) }, + {349, sConfigMgr->GetOption("Solocraft.Mauradon", 5.0) }, + {389, sConfigMgr->GetOption("Solocraft.OrgrimmarInstance", 5.0) }, // Ragefire + {409, sConfigMgr->GetOption("Solocraft.MoltenCore", 40.0) }, + {429, sConfigMgr->GetOption("Solocraft.DireMaul", 5.0) }, + {469, sConfigMgr->GetOption("Solocraft.BlackwingLair", 40.0) }, + {509, sConfigMgr->GetOption("Solocraft.AhnQiraj", 20.0) }, + {531, sConfigMgr->GetOption("Solocraft.AhnQirajTemple", 40.0) }, + + // BC Instances + {269, sConfigMgr->GetOption("Solocraft.CavernsOfTime", 5.0) }, // Black Morass + {532, sConfigMgr->GetOption("Solocraft.Karazahn", 10.0) }, + {534, sConfigMgr->GetOption("Solocraft.HyjalPast", 25.0) }, // Mount Hyjal + {540, sConfigMgr->GetOption("Solocraft.HellfireMilitary", 5.0) }, // The Shattered Halls + {542, sConfigMgr->GetOption("Solocraft.HellfireDemon", 5.0) }, // The Blood Furnace + {543, sConfigMgr->GetOption("Solocraft.HellfireRampart", 5.0) }, + {544, sConfigMgr->GetOption("Solocraft.HellfireRaid", 25.0) }, // Magtheridon's Lair + {545, sConfigMgr->GetOption("Solocraft.CoilfangPumping", 5.0) }, // The Steamvault + {546, sConfigMgr->GetOption("Solocraft.CoilfangMarsh", 5.0) }, // The Underbog + {547, sConfigMgr->GetOption("Solocraft.CoilfangDraenei", 5.0) }, // The Slavepens + {548, sConfigMgr->GetOption("Solocraft.CoilfangRaid", 25.0) }, // Serpentshrine Cavern + {550, sConfigMgr->GetOption("Solocraft.TempestKeepRaid", 25.0) }, // The Eye + {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcane", 5.0) }, // The Arcatraz + {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtrium", 5.0) }, // The Botanica + {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactory", 5.0) }, // The Mechanar + {555, sConfigMgr->GetOption("Solocraft.AuchindounShadow", 5.0) }, // Shadow Labyrinth + {556, sConfigMgr->GetOption("Solocraft.AuchindounDemon", 5.0) }, // Sethekk Halls + {557, sConfigMgr->GetOption("Solocraft.AuchindounEthereal", 5.0) }, // Mana-Tombs + {558, sConfigMgr->GetOption("Solocraft.AuchindounDraenei", 5.0) }, // Auchenai Crypts + {560, sConfigMgr->GetOption("Solocraft.HillsbradPast", 5.0) }, // Old Hillsbrad Foothills + {564, sConfigMgr->GetOption("Solocraft.BlackTemple", 25.0) }, + {565, sConfigMgr->GetOption("Solocraft.GruulsLair", 25.0) }, + {568, sConfigMgr->GetOption("Solocraft.ZulAman", 5.0) }, + {580, sConfigMgr->GetOption("Solocraft.SunwellPlateau", 25.0) }, + {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFix", 5.0) }, // Magister's Terrace + + // WOTLK Instances + {533, sConfigMgr->GetOption("Solocraft.StratholmeRaid", 10.0) }, // Nax 10 + {574, sConfigMgr->GetOption("Solocraft.Valgarde70", 5.0) }, // Utgarde Keep + {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacle", 5.0) }, + {576, sConfigMgr->GetOption("Solocraft.Nexus70", 5.0) }, // The Nexus + {578, sConfigMgr->GetOption("Solocraft.Nexus80", 5.0) }, // The Occulus + {595, sConfigMgr->GetOption("Solocraft.StratholmeCOT", 5.0) }, // The Culling of Stratholme + {599, sConfigMgr->GetOption("Solocraft.Ulduar70", 5.0) }, // Halls of Stone + {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeep", 5.0) }, // Drak'Tharon Keep + {601, sConfigMgr->GetOption("Solocraft.Azjol_Uppercity", 5.0) }, // Azjol-Nerub + {602, sConfigMgr->GetOption("Solocraft.Ulduar80", 5.0) }, // Halls of Lighting + {603, sConfigMgr->GetOption("Solocraft.UlduarRaid", 10.0) }, // Ulduar 10 + {604, sConfigMgr->GetOption("Solocraft.GunDrak", 5.0) }, + {608, sConfigMgr->GetOption("Solocraft.DalaranPrison", 5.0) }, // Violet Hold + {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlack", 10.0) }, // The Obsidian Sanctum 10 + {616, sConfigMgr->GetOption("Solocraft.NexusRaid", 10.0) }, // The Eye of Eternity 10 + {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCity", 5.0) }, // Ahn'kahet: The Old Kingdom + {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadel", 10.0) }, // Icecrown Citadel 10 + {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5Man", 5.0) }, // The Forge of Souls + {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaid", 10.0) }, // Trial of the Crusader 10 + {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeon", 5.0) }, // Trial of the Champion + {658, sConfigMgr->GetOption("Solocraft.QuarryOfTears", 5.0) }, // Pit of Saron + {668, sConfigMgr->GetOption("Solocraft.HallsOfReflection", 5.0) }, // Halls of Reflection + {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRed", 10.0) }, // The Ruby Sanctum 10 + }; + + // Heroics + diff_Multiplier_Heroics = + { + // BC Instances Heroics + {269, sConfigMgr->GetOption("Solocraft.CavernsOfTimeH", 5.0) }, // Black Morass H + {540, sConfigMgr->GetOption("Solocraft.HellfireMilitaryH", 5.0) }, // The Shattered Halls H + {542, sConfigMgr->GetOption("Solocraft.HellfireDemonH", 5.0) }, // The Blood Furnace H + {543, sConfigMgr->GetOption("Solocraft.HellfireRampartH", 5.0) }, // Heroic + {545, sConfigMgr->GetOption("Solocraft.CoilfangPumpingH", 5.0) }, // The Steamvault + {546, sConfigMgr->GetOption("Solocraft.CoilfangMarshH", 5.0) }, // The Underbog + {547, sConfigMgr->GetOption("Solocraft.CoilfangDraeneiH", 5.0) }, // The Slavepens H + {552, sConfigMgr->GetOption("Solocraft.TempestKeepArcaneH", 5.0) }, // The Arcatraz H + {553, sConfigMgr->GetOption("Solocraft.TempestKeepAtriumH", 5.0) }, // The Botanica H + {554, sConfigMgr->GetOption("Solocraft.TempestKeepFactoryH", 5.0) }, // The Mechanar H + {555, sConfigMgr->GetOption("Solocraft.AuchindounShadowH", 5.0) }, // Shadow Labyrinth H + {556, sConfigMgr->GetOption("Solocraft.AuchindounDemonH", 5.0) }, // Sethekk Halls H + {557, sConfigMgr->GetOption("Solocraft.AuchindounEtherealH", 5.0) }, // Mana-Tombs H + {558, sConfigMgr->GetOption("Solocraft.AuchindounDraeneiH", 5.0) }, // Auchenai Crypts H + {560, sConfigMgr->GetOption("Solocraft.HillsbradPastH", 5.0) }, // Old Hillsbrad Foothills H + {568, sConfigMgr->GetOption("Solocraft.ZulAmanH", 5.0) }, // Zul'Aman H + {585, sConfigMgr->GetOption("Solocraft.Sunwell5ManFixH", 5.0) }, // Magister's Terrace H + + // WOTLK Instances Heroics + {533, sConfigMgr->GetOption("Solocraft.StratholmeRaidH", 25.0) }, // Naxxramas 25 + {574, sConfigMgr->GetOption("Solocraft.Valgarde70H", 5.0) }, // Utgarde Keep H + {575, sConfigMgr->GetOption("Solocraft.UtgardePinnacleH", 5.0) }, // Utgarde Pinnacle H + {576, sConfigMgr->GetOption("Solocraft.Nexus70H", 5.0) }, // The Nexus H + {578, sConfigMgr->GetOption("Solocraft.Nexus80H", 5.0) }, // The Occulus H + {595, sConfigMgr->GetOption("Solocraft.StratholmeCOTH", 5.0) }, // The Culling of Stratholme H + {599, sConfigMgr->GetOption("Solocraft.Ulduar70H", 5.0) }, // Halls of Stone H + {600, sConfigMgr->GetOption("Solocraft.DrakTheronKeepH", 5.0) }, // Drak'Tharon Keep H + {601, sConfigMgr->GetOption("Solocraft.Azjol_UppercityH", 5.0) }, // Azjol-Nerub H + {602, sConfigMgr->GetOption("Solocraft.Ulduar80H", 5.0) }, // Halls of Lighting H + {603, sConfigMgr->GetOption("Solocraft.UlduarRaidH", 25.0) }, // Ulduar 25 + {604, sConfigMgr->GetOption("Solocraft.GunDrakH", 5.0) }, // Gundrak H + {608, sConfigMgr->GetOption("Solocraft.DalaranPrisonH", 5.0) }, // Violet Hold H + {615, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsBlackH", 25.0) }, // The Obsidian Sanctum 25 + {616, sConfigMgr->GetOption("Solocraft.NexusRaidH", 25.0) }, // The Eye of Eternity 25 + {619, sConfigMgr->GetOption("Solocraft.Azjol_LowerCityH", 5.0) }, // Ahn'kahet: The Old Kingdom H + {631, sConfigMgr->GetOption("Solocraft.IcecrownCitadelH", 25.0) }, // Icecrown Citadel 25 + {632, sConfigMgr->GetOption("Solocraft.IcecrownCitadel5ManH", 5.0) }, // The Forge of Souls + {649, sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH", 25.0) }, // Trial of the Crusader 25 + {650, sConfigMgr->GetOption("Solocraft.ArgentTournamentDungeonH", 5.0) }, // Trial of the Champion H + {658, sConfigMgr->GetOption("Solocraft.QuarryOfTearsH", 5.0) }, // Pit of Saron H + {668, sConfigMgr->GetOption("Solocraft.HallsOfReflectionH", 5.0) }, // Halls of Reflection H + {724, sConfigMgr->GetOption("Solocraft.ChamberOfAspectsRedH", 25.0) }, // The Ruby Sanctum 25 + }; + + //Unique Raids beyond the heroic and normal versions of themselves + D649H10 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic + D649H25 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic } }; class SolocraftAnnounce : public PlayerScript { - public: - SolocraftAnnounce() : PlayerScript("SolocraftAnnounce") {} void OnLogin(Player* player) override { - // Announce Module - if (SoloCraftEnable) + if (SoloCraftEnable && SoloCraftAnnounceModule) { - if (SoloCraftAnnounceModule) - { - ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00SoloCraft |rmodule."); - } + ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00SoloCraft |rmodule."); } } + void OnLogout(Player* player) override { - //Database query to see if an entry is still there - QueryResult result = CharacterDatabase.Query("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); - if (result) - { - //Remove database entry as the player has logged out - CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter()); - } + QueryResult result = CharacterDatabase.Query("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE `GUID`={}", player->GetGUID().GetCounter()); + if (result) + { + //Remove database entry as the player has logged out + CharacterDatabase.Execute("DELETE FROM `custom_solocraft_character_stats` WHERE `GUID`={}", player->GetGUID().GetCounter()); + } } - void OnGiveXP(Player* /*player*/, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override + void OnGiveXP(Player* /*player*/, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override { - if (SolocraftXPBalEnabled) - { - amount = uint32(amount * SoloCraftXPMod); // Decrease Experience based on number of players and difficulty of instance (0 to 100%) + if (SolocraftXPBalEnabled) + { + // Decrease Experience based on number of players and difficulty of instance (0 to 100%) + amount = uint32(amount * SoloCraftXPMod); } } }; -class solocraft_player_instance_handler : public PlayerScript { - +class SolocraftPlayerInstanceHandler : public PlayerScript +{ public: + SolocraftPlayerInstanceHandler() : PlayerScript("SolocraftPlayerInstanceHandler") {} - solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") {} - - void OnMapChanged(Player *player) override { + void OnMapChanged(Player* player) override + { if (sConfigMgr->GetOption("Solocraft.Enable", true)) { - Map *map = player->GetMap(); - float difficulty = CalculateDifficulty(map, player); - int dunLevel = CalculateDungeonLevel(map, player); - int numInGroup = GetNumInGroup(player); - int classBalance = GetClassBalance(player); + Map* map = player->GetMap(); + float difficulty = CalculateDifficulty(map); + uint32 dunLevel = CalculateDungeonLevel(map); + uint32 numInGroup = GetNumInGroup(player); + uint32 classBalance = GetClassBalance(player); ApplyBuffs(player, map, difficulty, dunLevel, numInGroup, classBalance); } } -private: + // Set the instance difficulty + float CalculateDifficulty(Map* map) + { + if (map) + { + if (map->Is25ManRaid()) + { + if (map->IsHeroic() && map->GetId() == 649) + { + return D649H25; + } + else if (diff_Multiplier_Heroics.find(map->GetId()) == diff_Multiplier_Heroics.end()) + { + return D25; + } + else + return diff_Multiplier_Heroics[map->GetId()]; + } - std::map _unitDifficulty; + if (map->IsHeroic()) + { + if (map->GetId() == 649) + { + return D649H10; + } + else if (diff_Multiplier_Heroics.find(map->GetId()) == diff_Multiplier_Heroics.end()) + { + return D10; + } + else + return diff_Multiplier_Heroics[map->GetId()]; + } - // Set the instance difficulty - float CalculateDifficulty(Map* map, Player* /*player*/) { - //float difficulty = 0.0;//changed from 1.0 - - if (map) { - //WOTLK 25 Man raids - if (map->Is25ManRaid()) - { - if (map->IsHeroic() && map->GetId() == 649) { - return D649H25; //Heroic Grand Trial of the Crusader - } - else if(diff_Multiplier_Heroics.find(map->GetId()) == diff_Multiplier_Heroics.end()){ - return D25; //map not found returns the catch all value - } - else - return diff_Multiplier_Heroics[map->GetId()]; //return the specific dungeon's level - } - - if (map->IsHeroic()) - { - //WOTLK 10 Man Heroic - if (map->GetId() == 649) { - return D649H10; - } - else if(diff_Multiplier_Heroics.find(map->GetId()) == diff_Multiplier_Heroics.end()){ - return D10; //map not found returns the catch all value - } - else - return diff_Multiplier_Heroics[map->GetId()]; //return the specific dungeon's level - } - - if (diff_Multiplier.find(map->GetId()) == diff_Multiplier.end()) { - //Catch Alls ----------------------5 Dungeons and 40 Raids - if (map->IsDungeon()) { - return D5; - } - else if (map->IsRaid()) { - return D40; - } - } - else - return diff_Multiplier[map->GetId()]; //return the specific dungeon's level - } - return 0; //return 0 + if (diff_Multiplier.find(map->GetId()) == diff_Multiplier.end()) + { + if (map->IsDungeon()) + { + return D5; + } + else if (map->IsRaid()) + { + return D40; + } + } + else + return diff_Multiplier[map->GetId()]; + } + + return 0; } // Set the Dungeon Level - int CalculateDungeonLevel(Map* map, Player* /*player*/) { - if (dungeons.find(map->GetId()) == dungeons.end()) - { - return SolocraftDungeonLevel; //map not found returns the catch all value - } - else - return dungeons[map->GetId()]; //return the specific dungeon's level - } + uint32 CalculateDungeonLevel(Map* map) + { + if (dungeons.find(map->GetId()) == dungeons.end()) + { + return SolocraftDungeonLevel; + } + else + { + return dungeons[map->GetId()]; + } + } // Get the group's size - int GetNumInGroup(Player* player) { - int numInGroup = 1; - Group *group = player->GetGroup(); - if (group) { + uint32 GetNumInGroup(Player* player) + { + uint32 numInGroup = 1; + Group* group = player->GetGroup(); + + if (group) + { Group::MemberSlotList const& groupMembers = group->GetMemberSlots(); numInGroup = groupMembers.size(); - } + } + return numInGroup; } - // Get the Player's class balance debuff - int GetClassBalance(Player* player) { - int classBalance = 100; - - if(classes.find(player->getClass()) == classes.end()){ - return classBalance; //class not found returns the catch all value - } - else if (classes[player->getClass()] >= 0 && classes[player->getClass()] <= 100) { - return classes[player->getClass()]; //return the specific class's Balance value - } - else - return classBalance; //class balance value invalid returns the catch all value - } - - // Apply the player buffs - void ApplyBuffs(Player* player, Map* map, float difficulty, int dunLevel, int numInGroup, int classBalance) + // Get the Player's class balance debuff + uint32 GetClassBalance(Player* player) { - //Check whether to buff the player or check to debuff back to normal - if (difficulty != 0) - { - std::ostringstream ss; - - int SpellPowerBonus = 0; - - //Check for an existing No XP Gain flag - other mod compatibility - if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) - { - SolocraftNoXPFlag = 1; - } - - if (player->getLevel() <= dunLevel + SolocraftLevelDiff) //If a player is too high level for dungeon don't buff but if in a group will count towards the group offset balancing. - { - - //Get Current members total difficulty offset and if it exceeds the difficulty offset of the dungeon then debuff new group members coming in until all members leave and re-enter. This happens when a player already inside dungeon invite others to the group but the player already has the full difficulty offset. - float GroupDifficulty = GetGroupDifficulty(player); - - //Check to either debuff or buff player entering dungeon. Debuff must be enabled in Config - if (GroupDifficulty >= difficulty && SoloCraftDebuffEnable == 1) - { - //Current dungeon offset exceeded - Debuff player modified by ClassBalance Adjustment - difficulty = (-abs(difficulty)) + ((((float)classBalance / 100) * difficulty) / numInGroup); - difficulty = roundf(difficulty * 100) / 100; //Float variables suck - - //Disable player XP gain if debuff applied - if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && SolocraftXPBalEnabled) - { - player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); - } - - //LOG_INFO("server.loading", "Group Difficulty %f", GroupDifficulty ); //New Logging system - } - else - { - //Current Dungeon offset not exceeded - Buff player - //Group difficulty and ClassBalance Adjustment - difficulty = (((float)classBalance / 100) * difficulty) / numInGroup; - difficulty = roundf(difficulty * 100) / 100; //Float variables suck - two decimal rounding - - //Set XP Modifier - SoloCraftXPMod = (1.04 / difficulty) - 0.02; - SoloCraftXPMod = roundf(SoloCraftXPMod * 100) / 100; - - //Check for negative XP modifier - Disable XP Gain - if (SoloCraftXPMod < 0) - { - SoloCraftXPMod = 0; - if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && SolocraftXPBalEnabled) - { - player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); - } - } - - //Check XP modifier for over max limit and adjust - if (SoloCraftXPMod > 1) - { - SoloCraftXPMod = 1.0; - } - - //LOG_INFO("server.loading", "Difficulty %f", difficulty ); //New Logging System - - } - - //Check Database for a current dungeon entry - QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); - - //Modify Player Stats - for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h - { - //Check for Dungeon to Dungeon Transfer and remove old buff - if (result) - { - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].Get() * (*result)[4].Get(), false); - } - // Buff the player - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * SoloCraftStatsMult, true); //Unitmods enum UNIT_MOD_STAT_START defined in Unit.h line 391 - - } - - // Set player health - player->SetFullHealth();//defined in Unit.h line 1524 - - // Set Pet Health - player->CastSpell(player, 6962, true); - - //Spellcaster Stat modify - if (player->getPowerType() == POWER_MANA || player->getClass() == 11) //Fixes Druid entering dungeon in Bear or Cat form - { - // Buff the player's mana - player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); - - //Check for Dungeon to Dungeon Transfer and remove old Spellpower buff - if (result) - { - // remove spellpower bonus - player->ApplySpellPowerBonus((*result)[3].Get() * (*result)[4].Get(),false); - } - - //Buff Spellpower - if (difficulty > 0) //Debuffed characters do not get spellpower - { - SpellPowerBonus = static_cast((player->getLevel() * SoloCraftSpellMult) * difficulty);//Yes, I pulled this calc out of my butt. - player->ApplySpellPowerBonus(SpellPowerBonus,true); - } - } - - //XP Gain Disabled - if (!SolocraftXPEnabled) - { - SoloCraftXPMod = 0; - if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) - { - player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); - } - } - - //Announcements - if (difficulty > 0) - { - // Announce to player - Buff - if (!SolocraftXPEnabled) - { - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Gain: |cffFF0000Disabled"; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); - } - else - { - if (!SolocraftXPBalEnabled) - { - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Balancing: |cffFF0000Disabled"; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); - } - else - { - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Balancing: |cff4CFF00Enabled"; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); - } - } - } - else - { - // Announce to player - Debuff - if (!SolocraftXPBalEnabled && SolocraftXPEnabled) - { - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); - } - else - { - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i and no XP will be awarded. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); - } - } - - // Save Player Dungeon Offsets to Database - CharacterDatabase.Execute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES ({}, {}, {}, {}, {})", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); - } - else - { - // Announce to player - Over Max Level Threshold - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000You have not been buffed. |cffFF8000 Your level is higher than the max level (%i) threshold for this dungeon."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), dunLevel + SolocraftLevelDiff); - ClearBuffs(player, map); //Check to revert player back to normal - } - } - else - { - ClearBuffs(player, map); //Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues - } - } + uint32 classBalance = 100; + + if (classes.find(player->getClass()) == classes.end()) + { + return classBalance; + } + else if (classes[player->getClass()] >= 0 && classes[player->getClass()] <= 100) + { + return classes[player->getClass()]; + } + else + return classBalance; + } // Get the current group members GUIDS and return the total sum of the difficulty offset by all group members currently in the dungeon - float GetGroupDifficulty(Player* player) { + float GetGroupDifficulty(Player* player) + { float GroupDifficulty = 0.0; - Group *group = player->GetGroup(); + Group* group = player->GetGroup(); + if (group) - { + { Group::MemberSlotList const& groupMembers = group->GetMemberSlots(); - for (Group::member_citerator itr = groupMembers.begin(); itr != groupMembers.end(); ++itr) - { - //Exclude player from the tally because the player is the one entering the dungeon - if (itr->guid != player->GetGUID()) - { - //Database query to find difficulty for each group member that is currently in an instance - QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = {}", itr->guid.GetCounter()); - - if (result) - { - //Test for debuffs already give to other members - They cannot be used to determine the total offset because negative numbers will skew the total difficulty offset - if ((*result)[1].Get() > 0) - { - GroupDifficulty = GroupDifficulty + (*result)[1].Get(); - } - } - } - } - } + for (Group::member_citerator itr = groupMembers.begin(); itr != groupMembers.end(); ++itr) + { + if (itr->guid != player->GetGUID()) + { + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE `GUID`={}", itr->guid.GetCounter()); + if (result) + { + if ((*result)[1].Get() > 0) + { + GroupDifficulty = GroupDifficulty + (*result)[1].Get(); + } + } + } + } + } + return GroupDifficulty; } - void ClearBuffs(Player* player, Map* map) + // Resets buffers + void ClearBuffs(Player* player) { + //Database query to get offset from the last instance player exited + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE `GUID`={}", player->GetGUID().GetCounter()); + uint32 SpellPowerBonus = 0; + + if (result) + { + float difficulty = (*result)[1].Get(); + SpellPowerBonus = (*result)[3].Get(); + float StatsMultPct = (*result)[4].Get(); + SoloCraftXPMod = 1.0; + + for (uint32 i = STAT_STRENGTH; i < MAX_STATS; ++i) + { + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * StatsMultPct, false); + } + + if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && !SolocraftNoXPFlag) + { + player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } - //Database query to get offset from the last instance player exited - QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter()); - if (result) - { - float difficulty = (*result)[1].Get(); - int SpellPowerBonus = (*result)[3].Get(); + SolocraftNoXPFlag = 0; + CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter()); + } - float StatsMultPct = (*result)[4].Get(); - SoloCraftXPMod = 1.0; + if (player->getPowerType() == POWER_MANA || player->getClass() == CLASS_DRUID) + { + player->ApplySpellPowerBonus(SpellPowerBonus, false); + } + } - // Inform the player + // Apply the player buffs + void ApplyBuffs(Player* player, Map* map, float difficulty, int dunLevel, int numInGroup, int classBalance) + { + // Check whether to buff the player or check to debuff back to normal + if (difficulty != 0) + { std::ostringstream ss; - ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " exited to %s - Reverting Difficulty Offset: %0.2f. Spellpower Bonus Removed: %i"; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus); - // Clear the buffs - for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) + int SpellPowerBonus = 0; + + // Check for an existing No XP Gain flag - other mod compatibility + if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) { - player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * StatsMultPct, false); + SolocraftNoXPFlag = 1; } - if (player->getPowerType() == POWER_MANA && difficulty > 0) - { - // remove spellpower bonus - player->ApplySpellPowerBonus(SpellPowerBonus,false); - //sLog->outError("%u: spellpower Bonus removed: %i", player->GetGUID(), SpellPowerBonus); - } - if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && !SolocraftNoXPFlag) - { - player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); - } - - //Reinit Existing No XP Gain flag check - SolocraftNoXPFlag = 0; - - //Remove database entry as the player is no longer in an instance - CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter()); - } + + // If a player is too high level for dungeon don't buff but if in a group will count towards the group offset balancing. + if (player->getLevel() <= dunLevel + SolocraftLevelDiff) + { + + // Get Current members total difficulty offset and if it exceeds the difficulty offset of the dungeon then debuff new group members coming in until all members leave and re-enter. This happens when a player already inside dungeon invite others to the group but the player already has the full difficulty offset. + float GroupDifficulty = GetGroupDifficulty(player); + + // Check to either debuff or buff player entering dungeon. Debuff must be enabled in Config + if (GroupDifficulty >= difficulty && SoloCraftDebuffEnable == 1) + { + // Current dungeon offset exceeded - Debuff player modified by ClassBalance Adjustment + difficulty = (-abs(difficulty)) + ((((float)classBalance / 100) * difficulty) / numInGroup); + // Float variables suck + difficulty = roundf(difficulty * 100) / 100; + + // Disable player XP gain if debuff applied + if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && SolocraftXPBalEnabled) + { + player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } + } + else + { + // Current Dungeon offset not exceeded - Buff player + // Group difficulty and ClassBalance Adjustment + difficulty = (((float)classBalance / 100) * difficulty) / numInGroup; + // Float variables suck - two decimal rounding + difficulty = roundf(difficulty * 100) / 100; + + // Set XP Modifier + SoloCraftXPMod = (1.04 / difficulty) - 0.02; + SoloCraftXPMod = roundf(SoloCraftXPMod * 100) / 100; + + // Check for negative XP modifier - Disable XP Gain + if (SoloCraftXPMod < 0) + { + SoloCraftXPMod = 0; + if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN) && SolocraftXPBalEnabled) + { + player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } + } + + // Check XP modifier for over max limit and adjust + if (SoloCraftXPMod > 1) + { + SoloCraftXPMod = 1.0; + } + } + + // Check Database for a current dungeon entry + QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE `GUID`={}", player->GetGUID().GetCounter()); + + // Modify Player Stats + // STATS defined/enum in SharedDefines.h + for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) + { + // Check for Dungeon to Dungeon Transfer and remove old buff + if (result) + { + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].Get() * (*result)[4].Get(), false); + } + // Buff the player + // Unitmods enum UNIT_MOD_STAT_START defined in Unit.h line 391 + player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * SoloCraftStatsMult, true); + + } + + // Set player health + // Defined in Unit.h line 1524 + player->SetFullHealth(); + + if (player->IsExistPet()) + { + // Set Pet Health + player->CastSpell(player, 6962, true); + + } + + // Spellcaster Stat modify + if (player->getPowerType() == POWER_MANA || player->getClass() == CLASS_DRUID) + { + // Buff the player's mana + player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); + + // Check for Dungeon to Dungeon Transfer and remove old Spellpower buff + if (result) + { + // remove spellpower bonus + player->ApplySpellPowerBonus((*result)[3].Get() * (*result)[4].Get(), false); + } + + // Buff Spellpower + // Debuffed characters do not get spellpower + if (difficulty > 0) + { + SpellPowerBonus = static_cast((player->getLevel() * SoloCraftSpellMult) * difficulty); + player->ApplySpellPowerBonus(SpellPowerBonus, true); + } + } + + // XP Gain Disabled + if (!SolocraftXPEnabled) + { + SoloCraftXPMod = 0; + if (!player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) + { + player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); + } + } + + // Announcements + if (difficulty > 0) + { + // Announce to player - Buff + if (!SolocraftXPEnabled) + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Gain: |cffFF0000Disabled"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); + } + else + { + if (!SolocraftXPBalEnabled) + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Balancing: |cffFF0000Disabled"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); + } + else + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %0.2f. Spellpower Bonus: %i. Class Balance Weight: %i. XP Balancing: |cff4CFF00Enabled"; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, SpellPowerBonus, classBalance); + } + } + } + else + { + // Announce to player - Debuff + if (!SolocraftXPBalEnabled && SolocraftXPEnabled) + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); + } + else + { + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000BE ADVISED - You have been debuffed by offset: %0.2f with a Class Balance Weight: %i and no XP will be awarded. |cffFF8000 A group member already inside has the dungeon's full buff offset. No Spellpower buff will be applied to spell casters. ALL group members must exit the dungeon and re-enter to receive a balanced offset."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty, classBalance); + } + } + + // Save Player Dungeon Offsets to Database + CharacterDatabase.Execute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES ({}, {}, {}, {}, {})", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult); + } + else + { + // Announce to player - Over Max Level Threshold + ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - |cffFF0000You have not been buffed. |cffFF8000 Your level is higher than the max level (%i) threshold for this dungeon."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), dunLevel + SolocraftLevelDiff); + ClearBuffs(player); // Check to revert player back to normal + } + } + else + { + ClearBuffs(player); // Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues + } } + +private: + std::map _unitDifficulty; }; void AddSolocraftScripts() { new SolocraftConfig(); new SolocraftAnnounce(); - new solocraft_player_instance_handler(); + new SolocraftPlayerInstanceHandler(); } From 99eac7f591d56ae2be8337d921942081601bcd65 Mon Sep 17 00:00:00 2001 From: Greg Flynn Date: Fri, 8 Sep 2023 07:58:35 -0400 Subject: [PATCH 41/46] fix BWL level (#41) --- conf/Solocraft.conf.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/Solocraft.conf.dist b/conf/Solocraft.conf.dist index 3f61c27..b37ae34 100644 --- a/conf/Solocraft.conf.dist +++ b/conf/Solocraft.conf.dist @@ -138,7 +138,7 @@ Solocraft.Mauradon = 5.0 Solocraft.OrgrimmarInstance = 5.0 Solocraft.MoltenCore = 40.0 Solocraft.DireMaul = 5.0 -Solocraft.BlackwingLair = 40.0 +Solocraft.BlackwingLair = 60.0 # Ruins of Ahn'Qiraj Solocraft.AhnQiraj = 20.0 Solocraft.AhnQirajTemple = 40.0 From 84f2e1af7af3369c3a392197a2281976821118c0 Mon Sep 17 00:00:00 2001 From: KJack Date: Fri, 15 Mar 2024 18:58:23 -0400 Subject: [PATCH 42/46] (feature) allow config to be reloaded without server restart. (#38) * Allow config to be reloaded without server restart. * comment unused variables --------- Co-authored-by: Walter Pagani Co-authored-by: Winfidonarleyan --- src/Solocraft.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 5969cd1..320ade1 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -40,12 +40,10 @@ class SolocraftConfig : public WorldScript public: SolocraftConfig() : WorldScript("SolocraftConfig") {} - void OnBeforeConfigLoad(bool reload) override + void OnBeforeConfigLoad(bool /*reload*/) override { - if (!reload) { - // Load Configuration Settings - SetInitialWorldSettings(); - } + // Load Configuration Settings + SetInitialWorldSettings(); } // Load Configuration Settings @@ -528,7 +526,7 @@ class SolocraftPlayerInstanceHandler : public PlayerScript int SpellPowerBonus = 0; - // Check for an existing No XP Gain flag - other mod compatibility + // Check for an existing No XP Gain flag - other mod compatibility if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) { SolocraftNoXPFlag = 1; From de2eda4b7d98fcd2a3a05c9b88e389521a8d3f45 Mon Sep 17 00:00:00 2001 From: Mike Delago <32778141+michaeldelago@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:45:16 -0400 Subject: [PATCH 43/46] Remove deprecated function/method calls (#45) --- src/Solocraft.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 320ade1..cc85459 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -533,7 +533,7 @@ class SolocraftPlayerInstanceHandler : public PlayerScript } // If a player is too high level for dungeon don't buff but if in a group will count towards the group offset balancing. - if (player->getLevel() <= dunLevel + SolocraftLevelDiff) + if (player->GetLevel() <= dunLevel + SolocraftLevelDiff) { // Get Current members total difficulty offset and if it exceeds the difficulty offset of the dungeon then debuff new group members coming in until all members leave and re-enter. This happens when a player already inside dungeon invite others to the group but the player already has the full difficulty offset. @@ -628,7 +628,7 @@ class SolocraftPlayerInstanceHandler : public PlayerScript // Debuffed characters do not get spellpower if (difficulty > 0) { - SpellPowerBonus = static_cast((player->getLevel() * SoloCraftSpellMult) * difficulty); + SpellPowerBonus = static_cast((player->GetLevel() * SoloCraftSpellMult) * difficulty); player->ApplySpellPowerBonus(SpellPowerBonus, true); } } From 2b8193eca1dff04177b53c566817bc60e8b020df Mon Sep 17 00:00:00 2001 From: Isaac Strong Date: Wed, 21 Aug 2024 02:19:31 -0700 Subject: [PATCH 44/46] fix(SoloCraft): Limit XP modification to instances only (#49) ## Changes Proposed This PR addresses an issue in the SoloCraft module where XP modification was being applied to all players, regardless of whether they were in an instance or not. The changes include: 1. Implemented a system to track whether players are in instances or not. 2. Modified the XP calculation to only apply when players are in instances (dungeons or raids). 3. Fixed build errors related to the use of ObjectGuid. ## Implementation Details - Added a `std::map` to track players' instance status. - Implemented `OnMapChanged` to update players' instance status. - Modified `OnGiveXP` to check instance status before applying XP modifications. - Updated `OnLogout` to clean up instance tracking data. ## How to Test 1. Enable the SoloCraft module. 2. Enter a dungeon or raid and kill some mobs. Verify that XP is modified as expected. 3. Exit the instance and kill mobs in the open world. Verify that XP is not modified. 4. Re-enter an instance and confirm that XP modification resumes. ## Issues Addressed This PR fixes the issue where XP modification was being applied globally, even outside of instances. --- src/Solocraft.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index cc85459..59410f5 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -11,6 +11,7 @@ #include "Chat.h" #include #include +#include "ObjectGuid.h" bool SoloCraftEnable = 1; bool SoloCraftAnnounceModule = 1; @@ -309,6 +310,9 @@ class SolocraftConfig : public WorldScript class SolocraftAnnounce : public PlayerScript { +private: + std::map playerInInstanceMap; + public: SolocraftAnnounce() : PlayerScript("SolocraftAnnounce") {} @@ -328,11 +332,24 @@ class SolocraftAnnounce : public PlayerScript //Remove database entry as the player has logged out CharacterDatabase.Execute("DELETE FROM `custom_solocraft_character_stats` WHERE `GUID`={}", player->GetGUID().GetCounter()); } + playerInInstanceMap.erase(player->GetGUID()); + } + + void OnMapChanged(Player* player) override + { + if (player->GetMap()->IsDungeon() || player->GetMap()->IsRaid()) + { + playerInInstanceMap[player->GetGUID()] = true; + } + else + { + playerInInstanceMap[player->GetGUID()] = false; + } } - void OnGiveXP(Player* /*player*/, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override + void OnGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override { - if (SolocraftXPBalEnabled) + if (SolocraftXPBalEnabled && playerInInstanceMap[player->GetGUID()]) { // Decrease Experience based on number of players and difficulty of instance (0 to 100%) amount = uint32(amount * SoloCraftXPMod); From a1902a81004a68c425073506e71651d983943194 Mon Sep 17 00:00:00 2001 From: valsan-azerty-boi <52854501+valsan-azerty-boi@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:37:12 +0200 Subject: [PATCH 45/46] feat(SoloCraft): exclude map/instance from Solocraft scaling with conf (#50) * Exclude map/instance from Solocraft scaling with conf * include cstdint --- .gitignore | 5 +++++ conf/Solocraft.conf.dist | 12 ++++++++++++ src/Solocraft.cpp | 31 +++++++++++++++++++++++++------ src/utils/Utils.cpp | 16 ++++++++++++++++ src/utils/Utils.h | 21 +++++++++++++++++++++ 5 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 src/utils/Utils.cpp create mode 100644 src/utils/Utils.h diff --git a/.gitignore b/.gitignore index c6e1299..bd7065f 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,8 @@ local.properties .loadpath .project .cproject + +# +# Visual Studio Code +# +.vscode/ diff --git a/conf/Solocraft.conf.dist b/conf/Solocraft.conf.dist index b37ae34..1e72470 100644 --- a/conf/Solocraft.conf.dist +++ b/conf/Solocraft.conf.dist @@ -439,3 +439,15 @@ Solocraft.QuarryOfTears.Level = 78 Solocraft.HallsOfReflection.Level = 78 # The Ruby Sanctum Solocraft.ChamberOfAspectsRed.Level = 80 + +################################################################################################### +# Misc +################################################################################################### + +# Map excluded +# This settings excludes some maps from the Solocraft instance scaling + +# Example: +# Solocraft.Instance.Excluded = "30,489,529,559,562,566,572,607,617,618,628" +# This example excludes scaling in PvP BG & Arena maps +Solocraft.Instance.Excluded = "" diff --git a/src/Solocraft.cpp b/src/Solocraft.cpp index 59410f5..1a2b350 100644 --- a/src/Solocraft.cpp +++ b/src/Solocraft.cpp @@ -12,6 +12,11 @@ #include #include #include "ObjectGuid.h" +#include "utils/Utils.h" +#include +#include +#include +#include bool SoloCraftEnable = 1; bool SoloCraftAnnounceModule = 1; @@ -28,6 +33,7 @@ std::unordered_map classes; std::unordered_map dungeons; std::unordered_map diff_Multiplier; std::unordered_map diff_Multiplier_Heroics; +std::vector SolocraftInstanceExcluded; float D5 = 1.0; float D10 = 1.0; @@ -305,6 +311,9 @@ class SolocraftConfig : public WorldScript //Unique Raids beyond the heroic and normal versions of themselves D649H10 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH10", 10.0); //Trial of the Crusader 10 Heroic D649H25 = sConfigMgr->GetOption("Solocraft.ArgentTournamentRaidH25", 25.0); //Trial of the Crusader 25 Heroic + + //Get from conf excluded map for Solocraft scaling + LoadList(sConfigMgr->GetOption("Solocraft.Instance.Excluded", ""), SolocraftInstanceExcluded); } }; @@ -361,6 +370,11 @@ class SolocraftPlayerInstanceHandler : public PlayerScript { public: SolocraftPlayerInstanceHandler() : PlayerScript("SolocraftPlayerInstanceHandler") {} + + bool IsInSolocraftInstanceExcludedList(uint32 id) + { + return find(SolocraftInstanceExcluded.begin(), SolocraftInstanceExcluded.end(), id) != SolocraftInstanceExcluded.end(); + } void OnMapChanged(Player* player) override { @@ -380,6 +394,11 @@ class SolocraftPlayerInstanceHandler : public PlayerScript { if (map) { + if (IsInSolocraftInstanceExcludedList(map->GetId())) + { + return 0; + } + if (map->Is25ManRaid()) { if (map->IsHeroic() && map->GetId() == 649) @@ -536,8 +555,12 @@ class SolocraftPlayerInstanceHandler : public PlayerScript // Apply the player buffs void ApplyBuffs(Player* player, Map* map, float difficulty, int dunLevel, int numInGroup, int classBalance) { - // Check whether to buff the player or check to debuff back to normal - if (difficulty != 0) + // Check whether to debuff back to normal or check to buff the player + if (difficulty == 0 || IsInSolocraftInstanceExcludedList(map->GetId())) + { + ClearBuffs(player); // Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues + } + else { std::ostringstream ss; @@ -709,10 +732,6 @@ class SolocraftPlayerInstanceHandler : public PlayerScript ClearBuffs(player); // Check to revert player back to normal } } - else - { - ClearBuffs(player); // Check to revert player back to normal - Moving this here fixed logout and login while in instance buff and debuff issues - } } private: diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp new file mode 100644 index 0000000..c3b705e --- /dev/null +++ b/src/utils/Utils.cpp @@ -0,0 +1,16 @@ +#include "Utils.h" +#include +#include +#include +#include + +std::vector split(const std::string& str, char delimiter) { + std::vector res; + if (str.empty()) return res; + std::string token; + std::istringstream tokenStream(str); + while (std::getline(tokenStream, token, delimiter)) { + res.push_back(token); + } + return res; +} diff --git a/src/utils/Utils.h b/src/utils/Utils.h new file mode 100644 index 0000000..9b65574 --- /dev/null +++ b/src/utils/Utils.h @@ -0,0 +1,21 @@ +#ifndef UTILS_H +#define UTILS_H + +#include +#include +#include +#include +#include + +std::vector split(const std::string& str, char delimiter); + +template +void LoadList(const std::string& value, T& list) { + std::vector ids = split(value, ','); + for (const std::string& id_str : ids) { + uint32_t id = static_cast(std::atoi(id_str.c_str())); + list.push_back(id); + } +} + +#endif From e3de03194b5d124fd1dda7d9c3759d12169d3686 Mon Sep 17 00:00:00 2001 From: Trus3683 <152137641+Trus3683@users.noreply.github.com> Date: Sun, 8 Sep 2024 05:05:59 -0700 Subject: [PATCH 46/46] Fix BWL scaling in Solocraft.conf.dist (#51) BWL instance level and player count were swapped causing the module to incorrectly apply zero scaling to level 60 characters. --- conf/Solocraft.conf.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/Solocraft.conf.dist b/conf/Solocraft.conf.dist index 1e72470..75c4787 100644 --- a/conf/Solocraft.conf.dist +++ b/conf/Solocraft.conf.dist @@ -138,7 +138,7 @@ Solocraft.Mauradon = 5.0 Solocraft.OrgrimmarInstance = 5.0 Solocraft.MoltenCore = 40.0 Solocraft.DireMaul = 5.0 -Solocraft.BlackwingLair = 60.0 +Solocraft.BlackwingLair = 40.0 # Ruins of Ahn'Qiraj Solocraft.AhnQiraj = 20.0 Solocraft.AhnQirajTemple = 40.0 @@ -335,7 +335,7 @@ Solocraft.Mauradon.Level = 48 Solocraft.OrgrimmarInstance.Level = 15 Solocraft.MoltenCore.Level = 60 Solocraft.DireMaul.Level = 48 -Solocraft.BlackwingLair.Level = 40 +Solocraft.BlackwingLair.Level = 60 # Ruins of Ahn'Qiraj Solocraft.AhnQiraj.Level = 60 Solocraft.AhnQirajTemple.Level = 60