@@ -3755,11 +3755,12 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
3755
3755
UpdateFreeTalentPoints(false);
3756
3756
}
3757
3757
3758
- // update free primary prof.points (if any , can be none in case GM .learn prof. learning)
3758
+ // update free primary prof.points (if not overflow setting , can be in case GM use before .learn prof. learning)
3759
3759
if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id))
3760
3760
{
3761
3761
uint32 freeProfs = GetFreePrimaryProfessionPoints() + 1;
3762
- if (freeProfs <= sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL))
3762
+ uint32 maxProfs = GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT)) ? sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL) : 10;
3763
+ if (freeProfs <= maxProfs)
3763
3764
{
3764
3765
SetFreePrimaryProfessions(freeProfs);
3765
3766
}
@@ -4443,7 +4444,16 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
4443
4444
return TRAINER_SPELL_RED;
4444
4445
}
4445
4446
4447
+ bool prof = SpellMgr::IsProfessionSpell(trainer_spell->spell);
4446
4448
4449
+ // check level requirement
4450
+ if (!prof || GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL)))
4451
+ {
4452
+ if (getLevel() < reqLevel)
4453
+ {
4454
+ return TRAINER_SPELL_RED;
4455
+ }
4456
+ }
4447
4457
4448
4458
if (SpellChainNode const* spell_chain = sSpellMgr.GetSpellChainNode(trainer_spell->spell))
4449
4459
{
@@ -4460,18 +4470,12 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
4460
4470
}
4461
4471
}
4462
4472
4463
- // check level requirement
4464
- bool prof = SpellMgr::IsProfessionSpell(trainer_spell->spell);
4465
- if (prof || trainer_spell->reqLevel && (trainer_spell->reqLevel) < reqLevel)
4466
- {
4467
- return TRAINER_SPELL_RED;
4468
- }
4469
-
4470
4473
// check skill requirement
4471
- if (prof || trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue)
4472
- {
4473
- return TRAINER_SPELL_RED;
4474
- }
4474
+ if (!prof || GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_SKILL)))
4475
+ if (trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue)
4476
+ {
4477
+ return TRAINER_SPELL_RED;
4478
+ }
4475
4479
4476
4480
// exist, already checked at loading
4477
4481
SpellEntry const* spell = sSpellStore.LookupEntry(trainer_spell->spell);
@@ -21973,7 +21977,9 @@ template void Player::UpdateVisibilityOf(WorldObject const* viewPoint, DynamicOb
21973
21977
21974
21978
void Player::InitPrimaryProfessions()
21975
21979
{
21976
- SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL));
21980
+ uint32 maxProfs = GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT))
21981
+ ? sWorld.getConfig(CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL) : 10;
21982
+ SetFreePrimaryProfessions(maxProfs);
21977
21983
}
21978
21984
21979
21985
void Player::SendComboPoints()
0 commit comments