From 4daa549ca0ca540562b6b858fb746276a307fbe9 Mon Sep 17 00:00:00 2001 From: Antz Date: Thu, 29 Feb 2024 10:11:02 +0000 Subject: [PATCH 1/2] [Deps] Updated Deps submodule to latest revision --- dep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dep b/dep index ef8075ac6..a6901739e 160000 --- a/dep +++ b/dep @@ -1 +1 @@ -Subproject commit ef8075ac6255435030e74e625c9f5170c12ca3cf +Subproject commit a6901739e4ad37bfb9a178a6320e4d6969c00b53 From 118c74814b77b3e27d2bd468899788790591e50a Mon Sep 17 00:00:00 2001 From: billy1arm Date: Sun, 23 Jun 2024 22:24:30 +0100 Subject: [PATCH 2/2] Revert "Fix Trade Skill Limit (#192)" This commit broke guild creation This reverts commit 360ddbdf862780c35664d44e15f9de9a3be13dab. --- cmake/MangosParams.cmake | 2 +- src/game/Object/Player.cpp | 34 +++++++++++++++++++------------- src/game/WorldHandlers/World.cpp | 4 ++++ src/game/WorldHandlers/World.h | 3 +++ src/mangosd/mangosd.conf.dist.in | 15 ++++++++++++++ 5 files changed, 43 insertions(+), 15 deletions(-) diff --git a/cmake/MangosParams.cmake b/cmake/MangosParams.cmake index 9020f2d09..bc020d8eb 100644 --- a/cmake/MangosParams.cmake +++ b/cmake/MangosParams.cmake @@ -1,5 +1,5 @@ set(MANGOS_EXP "TBC") set(MANGOS_PKG "Mangos One") -set(MANGOS_WORLD_VER 2023102200) +set(MANGOS_WORLD_VER 2023062700) set(MANGOS_REALM_VER 2021010100) set(MANGOS_AHBOT_VER 2021010100) diff --git a/src/game/Object/Player.cpp b/src/game/Object/Player.cpp index 9255d651f..6e93eb30c 100644 --- a/src/game/Object/Player.cpp +++ b/src/game/Object/Player.cpp @@ -3755,11 +3755,12 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo UpdateFreeTalentPoints(false); } - // update free primary prof.points (if any, can be none in case GM .learn prof. learning) + // update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning) if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id)) { uint32 freeProfs = GetFreePrimaryProfessionPoints() + 1; - if (freeProfs <= sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL)) + uint32 maxProfs = GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT)) ? sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL) : 10; + if (freeProfs <= maxProfs) { SetFreePrimaryProfessions(freeProfs); } @@ -4443,7 +4444,16 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell return TRAINER_SPELL_RED; } + bool prof = SpellMgr::IsProfessionSpell(trainer_spell->spell); + // check level requirement + if (!prof || GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL))) + { + if (getLevel() < reqLevel) + { + return TRAINER_SPELL_RED; + } + } if (SpellChainNode const* spell_chain = sSpellMgr.GetSpellChainNode(trainer_spell->spell)) { @@ -4460,18 +4470,12 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell } } - // check level requirement - bool prof = SpellMgr::IsProfessionSpell(trainer_spell->spell); - if (prof || trainer_spell->reqLevel && (trainer_spell->reqLevel) < reqLevel) - { - return TRAINER_SPELL_RED; - } - // check skill requirement - if (prof || trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue) - { - return TRAINER_SPELL_RED; - } + if (!prof || GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_SKILL))) + if (trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue) + { + return TRAINER_SPELL_RED; + } // exist, already checked at loading SpellEntry const* spell = sSpellStore.LookupEntry(trainer_spell->spell); @@ -21973,7 +21977,9 @@ template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, DynamicOb void Player::InitPrimaryProfessions() { - SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL)); + uint32 maxProfs = GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT)) + ? sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL) : 10; + SetFreePrimaryProfessions(maxProfs); } void Player::SendComboPoints() diff --git a/src/game/WorldHandlers/World.cpp b/src/game/WorldHandlers/World.cpp index bc23331e3..c2454e60e 100644 --- a/src/game/WorldHandlers/World.cpp +++ b/src/game/WorldHandlers/World.cpp @@ -637,6 +637,10 @@ void World::LoadConfigSettings(bool reload) setConfigMinMax(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL, "MaxPrimaryTradeSkill", 2, 0, 10); + setConfigMinMax(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT, "TradeSkill.GMIgnore.MaxPrimarySkillsCount", SEC_CONSOLE, SEC_PLAYER, SEC_CONSOLE); + setConfigMinMax(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL, "TradeSkill.GMIgnore.Level", SEC_CONSOLE, SEC_PLAYER, SEC_CONSOLE); + setConfigMinMax(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_SKILL, "TradeSkill.GMIgnore.Skill", SEC_CONSOLE, SEC_PLAYER, SEC_CONSOLE); + setConfigMinMax(CONFIG_UINT32_MIN_PETITION_SIGNS, "MinPetitionSigns", 9, 0, 9); setConfig(CONFIG_UINT32_GM_LOGIN_STATE, "GM.LoginState", 2); diff --git a/src/game/WorldHandlers/World.h b/src/game/WorldHandlers/World.h index be71f6552..d2be4e0bd 100644 --- a/src/game/WorldHandlers/World.h +++ b/src/game/WorldHandlers/World.h @@ -115,6 +115,9 @@ enum eConfigUInt32Values CONFIG_UINT32_MAX_SPELL_CASTS_IN_CHAIN, CONFIG_UINT32_RABBIT_DAY, CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL, + CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT, + CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL, + CONFIG_UINT32_TRADE_SKILL_GMIGNORE_SKILL, CONFIG_UINT32_MIN_PETITION_SIGNS, CONFIG_UINT32_GM_LOGIN_STATE, CONFIG_UINT32_GM_VISIBLE_STATE, diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index 6b69a6258..196215f73 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -706,6 +706,18 @@ SD3ErrorLogFile = "scriptdev3-errors.log" # Default: 2 # Max : 10 # +# TradeSkill.GMIgnore.MaxPrimarySkillsCount +# GM level starting from max primary skill count requirement ignored. +# Default: 4 (Console as noneone) +# +# TradeSkill.GMIgnore.Level +# GM level starting from trade skill level requirement ignored. +# Default: 4 (Console as noneone) +# +# TradeSkill.GMIgnore.Skill +# GM level starting from trade skill skill requirement ignored. +# Default: 4 (Console as noneone) +# # MinPetitionSigns # Min signatures count to creating guild (0..9). # Default: 9 @@ -820,6 +832,9 @@ TimerBar.Breath.Max = 180 TimerBar.Fire.GMLevel = 4 TimerBar.Fire.Max = 1 MaxPrimaryTradeSkill = 2 +TradeSkill.GMIgnore.MaxPrimarySkillsCount = 4 +TradeSkill.GMIgnore.Level = 4 +TradeSkill.GMIgnore.Skill = 4 MinPetitionSigns = 9 MaxGroupXPDistance = 74 MailDeliveryDelay = 3600