Skip to content

Commit 3afa475

Browse files
committed
Revert "Fix Trade Skill Limit (#192)"
This reverts commit 2a23663. This commit broke guild creation
1 parent 4602e95 commit 3afa475

File tree

5 files changed

+36
-9
lines changed

5 files changed

+36
-9
lines changed

cmake/MangosParams.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(MANGOS_EXP "CLASSIC")
22
set(MANGOS_PKG "Mangos Zero")
3-
set(MANGOS_WORLD_VER 2023053000)
3+
set(MANGOS_WORLD_VER 2023031100)
44
set(MANGOS_REALM_VER 2021010100)
55
set(MANGOS_AHBOT_VER 2021010100)

src/game/Object/Player.cpp

+13-8
Original file line numberDiff line numberDiff line change
@@ -3661,11 +3661,12 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
36613661
UpdateFreeTalentPoints(false);
36623662
}
36633663

3664-
// update free primary prof.points (if any, can be none in case GM .learn prof. learning)
3664+
// update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning)
36653665
if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id))
36663666
{
36673667
uint32 freeProfs = GetFreePrimaryProfessionPoints() + 1;
3668-
if (freeProfs <= sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL))
3668+
uint32 maxProfs = GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT)) ? sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL) : 10;
3669+
if (freeProfs <= maxProfs)
36693670
{
36703671
SetFreePrimaryProfessions(freeProfs);
36713672
}
@@ -4312,6 +4313,8 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
43124313
return TRAINER_SPELL_RED;
43134314
}
43144315

4316+
bool prof = SpellMgr::IsProfessionSpell(trainer_spell->spell);
4317+
43154318
// check level requirement
43164319
uint32 spellLevel = reqLevel ? reqLevel : TriggerSpell->spellLevel;
43174320
if (getLevel() < spellLevel)
@@ -4335,11 +4338,11 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
43354338
}
43364339

43374340
// check skill requirement
4338-
bool prof = SpellMgr::IsProfessionSpell(trainer_spell->spell);
4339-
if (prof || trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue)
4340-
{
4341-
return TRAINER_SPELL_RED;
4342-
}
4341+
if (!prof || GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_SKILL)))
4342+
if (trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue)
4343+
{
4344+
return TRAINER_SPELL_RED;
4345+
}
43434346

43444347
// exist, already checked at loading
43454348

@@ -20814,7 +20817,9 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* targe
2081420817

2081520818
void Player::InitPrimaryProfessions()
2081620819
{
20817-
SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL));
20820+
uint32 maxProfs = GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT))
20821+
? sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL) : 10;
20822+
SetFreePrimaryProfessions(maxProfs);
2081820823
}
2081920824

2082020825
void Player::SetComboPoints()

src/game/WorldHandlers/World.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,10 @@ void World::LoadConfigSettings(bool reload)
649649

650650
setConfigMinMax(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL, "MaxPrimaryTradeSkill", 2, 0, 10);
651651

652+
setConfigMinMax(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT, "TradeSkill.GMIgnore.MaxPrimarySkillsCount", SEC_CONSOLE, SEC_PLAYER, SEC_CONSOLE);
653+
setConfigMinMax(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL, "TradeSkill.GMIgnore.Level", SEC_CONSOLE, SEC_PLAYER, SEC_CONSOLE);
654+
setConfigMinMax(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_SKILL, "TradeSkill.GMIgnore.Skill", SEC_CONSOLE, SEC_PLAYER, SEC_CONSOLE);
655+
652656
setConfigMinMax(CONFIG_UINT32_MIN_PETITION_SIGNS, "MinPetitionSigns", 9, 0, 9);
653657

654658
setConfig(CONFIG_UINT32_GM_LOGIN_STATE, "GM.LoginState", 2);

src/game/WorldHandlers/World.h

+3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ enum eConfigUInt32Values
120120
CONFIG_UINT32_TRAIN_EPIC_MOUNT_COST,
121121
CONFIG_UINT32_RABBIT_DAY,
122122
CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL,
123+
CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT,
124+
CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL,
125+
CONFIG_UINT32_TRADE_SKILL_GMIGNORE_SKILL,
123126
CONFIG_UINT32_MIN_PETITION_SIGNS,
124127
CONFIG_UINT32_GM_LOGIN_STATE,
125128
CONFIG_UINT32_GM_VISIBLE_STATE,

src/mangosd/mangosd.conf.dist.in

+15
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,18 @@ SD3ErrorLogFile = "scriptdev3-errors.log"
715715
# Default: 2
716716
# Max : 10
717717
#
718+
# TradeSkill.GMIgnore.MaxPrimarySkillsCount
719+
# GM level starting from max primary skill count requirement ignored.
720+
# Default: 4 (Console as noneone)
721+
#
722+
# TradeSkill.GMIgnore.Level
723+
# GM level starting from trade skill level requirement ignored.
724+
# Default: 4 (Console as noneone)
725+
#
726+
# TradeSkill.GMIgnore.Skill
727+
# GM level starting from trade skill skill requirement ignored.
728+
# Default: 4 (Console as noneone)
729+
#
718730
# MinPetitionSigns
719731
# Min signatures count to creating guild (0..9).
720732
# Default: 9
@@ -824,6 +836,9 @@ TimerBar.Breath.Max = 60
824836
TimerBar.Fire.GMLevel = 4
825837
TimerBar.Fire.Max = 1
826838
MaxPrimaryTradeSkill = 2
839+
TradeSkill.GMIgnore.MaxPrimarySkillsCount = 4
840+
TradeSkill.GMIgnore.Level = 4
841+
TradeSkill.GMIgnore.Skill = 4
827842
MinPetitionSigns = 9
828843
MaxGroupXPDistance = 74
829844
MailDeliveryDelay = 3600

0 commit comments

Comments
 (0)