Jump to content

[One] Question about how (max) primary professions are handled.


evilatwow

Recommended Posts

Mangos Version: latest One sources at this moment: MaNGOS One/0.12.1 (* * Revision 1287 - *) for Win32 (little-endian)

Database Name and Version : TBC-DB Full Release 1.1.0 (+ extra SQL updates from MaNGOS One 1153 => 1287)

Using the above combination, it seems characters can keep learning new primary professions. My MaNGOS configuration contains "MaxPrimaryTradeSkill = 2" so I would expect a maximum of two, but that doesn't seem to be the case, despite the fact that I can see some relevant code and checks. For instance:

In WorldSession::SendTrainerList:

bool can_learn_primary_prof = GetPlayer()->GetFreePrimaryProfessionPoints() > 0;

and in Player::GetTrainerSpellState:

// check primary prof. limit
if(sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell->Id) && GetFreePrimaryProfessionPoints() == 0)
   return TRAINER_SPELL_GREEN_DISABLED;

and functions like Player::SetFreePrimaryProfessions etc.

I'm not sure I fully understand how MaNGOS handles primary professions, but after quite some digging in the code, it is my understanding that MaNGOS uses the SpellMgr to figure it out by means of the spell IDs and the use of DBC data (using IsPrimaryProfessionSpell and IsPrimaryProfessionSkill functions, that get their info from Spell.dbc and SkillLine.dbc).

My initial guess was that it's a DB issue. Let's take mining as an example. When querying my DB for the Ironforge mining trainer (and many other mining trainers) it shows, in the npc_trainer_template table, that there is an entry 1010 with associated spell 2581. That spell seems to be Apprentice mining indeed, and everything works fine when I buy the spell from the trainer (I get the mining skill and smelting etc). When I log out and check the character's spells, it has both 2581 and 2575 in the character_spell table. So whether MaNGOS would check for the actual rank 1 skill spell ('Mining') or the 'Apprentice' spell wouldn't even matter as the char has both. A similar thing applies to other professions like leatherworking and skinning etc, yet somehow I can learn more than two professions without a problem. What am I missing?

Link to comment
Share on other sites

  • 2 months later...

Hi, No fix to the problem yet?

I'm facing the same issue since few months ago and it really bugs me...

I checked NPC_trainer table only to found nothing mattered however I alter them...

It's a wild guess, but I suspect this concerns core side... And I'm newbie In matters of coding :(

So, I'd be greatful if you let me know there was any progress :)

Have a nice day, folks.

Link to comment
Share on other sites

Hi,

The spell learn by all profession trainers are not good in the npc_trainer_template.

So, the core doesn't understand, the spell learn is a "ProfessionFirstRankSpell", so you can learn all profession.

You must replace all wrong spell for all profession trainer.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use