Jump to content

[Fixed in 11857][Bug] Druid trainers


Guest Jethrogibbs

Recommended Posts

There is probably some core problem related, the problem is that I only know that druids can be used for mounts or other hairy desires.

So:

Can you please give spell-ids of spells that are taught on wrong level, and which requirements they should have, and how they should be obtained (for proper testing)

Link to comment
Share on other sites

diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp
index db7b035..d2b9a0c 100644
--- a/src/game/NPCHandler.cpp
+++ b/src/game/NPCHandler.cpp
@@ -131,7 +131,7 @@ static void SendTrainerSpellHelper(WorldPacket& data, TrainerSpell const* tSpell
    data << uint32(primary_prof_first_rank && can_learn_primary_prof ? 1 : 0);
    // primary prof. learn confirmation dialog
    data << uint32(primary_prof_first_rank ? 1 : 0);    // must be equal prev. field to have learn button in enabled state
-    data << uint8(skillReqLevel ? skillReqLevel : tSpell->reqLevel);
+    data << uint8(std::max(skillReqLevel, tSpell->reqLevel));
    data << uint32(tSpell->reqSkill);
    data << uint32(tSpell->reqSkillValue);
    data << uint32(!tSpell->IsCastable() && chain_node ? (chain_node->prev ? chain_node->prev : chain_node->req) : 0);

Seems to be an improvement for druid trainers. Not yet checked for other cases.

Link to comment
Share on other sites

diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp
index db7b035..d2b9a0c 100644
--- a/src/game/NPCHandler.cpp
+++ b/src/game/NPCHandler.cpp
@@ -131,7 +131,7 @@ static void SendTrainerSpellHelper(WorldPacket& data, TrainerSpell const* tSpell
    data << uint32(primary_prof_first_rank && can_learn_primary_prof ? 1 : 0);
    // primary prof. learn confirmation dialog
    data << uint32(primary_prof_first_rank ? 1 : 0);    // must be equal prev. field to have learn button in enabled state
-    data << uint8(skillReqLevel ? skillReqLevel : tSpell->reqLevel);
+    data << uint8(std::max(skillReqLevel, tSpell->reqLevel));
    data << uint32(tSpell->reqSkill);
    data << uint32(tSpell->reqSkillValue);
    data << uint32(!tSpell->IsCastable() && chain_node ? (chain_node->prev ? chain_node->prev : chain_node->req) : 0);

Seems to be an improvement for druid trainers. Not yet checked for other cases.

What you will do if need overwrite wrong high level req in dbc?

Link to comment
Share on other sites

With the current implementation

-    data << uint8(skillReqLevel ? skillReqLevel : tSpell->reqLevel); 
+   data << uint8(tSpell->reqLevel);

would work best.

Because even when a skillReqLevel is provided, learning the spell would fail on

   // check level requirement 
   if (!prof || GetSession()->GetSecurity() < AccountTypes(sWorld.getConfig(CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL))) 
       if (getLevel() < trainer_spell->reqLevel) 
           return TRAINER_SPELL_RED;

That's why the druid spells only show up green when another spell is learned (client side list update based on the required level?).

And it's the reason that it's not possible to learn those druid spells regardless of having those spells set to a lower required level in the packet.

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