mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Packets: added opcode handlers and packet structures for CMSG_LEARN_TALENT and CMSG_SET_PRIMARY_TALENT_TREE
This commit is contained in:
@@ -26,34 +26,18 @@
|
||||
#include "SpellPackets.h"
|
||||
#include "TalentPackets.h"
|
||||
|
||||
void WorldSession::HandleLearnTalentsOpcode(WorldPackets::Talent::LearnTalents& packet)
|
||||
void WorldSession::HandleLearnTalentOpcode(WorldPackets::Talent::LearnTalent& /*packet*/)
|
||||
{
|
||||
WorldPackets::Talent::LearnTalentFailed learnTalentFailed;
|
||||
bool anythingLearned = false;
|
||||
for (uint32 talentId : packet.Talents)
|
||||
{
|
||||
if (TalentLearnResult result = _player->LearnTalent(talentId, &learnTalentFailed.SpellID))
|
||||
{
|
||||
if (!learnTalentFailed.Reason)
|
||||
learnTalentFailed.Reason = result;
|
||||
|
||||
learnTalentFailed.Talents.push_back(talentId);
|
||||
}
|
||||
else
|
||||
anythingLearned = true;
|
||||
}
|
||||
|
||||
if (learnTalentFailed.Reason)
|
||||
SendPacket(learnTalentFailed.Write());
|
||||
|
||||
if (anythingLearned)
|
||||
_player->SendTalentsInfoData();
|
||||
}
|
||||
|
||||
void WorldSession::HandleLearnPreviewTalentsOpcode(WorldPackets::Talent::LearnPreviewTalents& /*packet*/)
|
||||
{
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetPrimaryTalentTreeOpcode(WorldPackets::Talent::SetPrimaryTalentTree& /*packet*/)
|
||||
{
|
||||
}
|
||||
|
||||
void WorldSession::HandleConfirmRespecWipeOpcode(WorldPackets::Talent::ConfirmRespecWipe& confirmRespecWipe)
|
||||
{
|
||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(confirmRespecWipe.RespecMaster, UNIT_NPC_FLAG_TRAINER, UNIT_NPC_FLAG_2_NONE);
|
||||
|
||||
Reference in New Issue
Block a user