mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Player: Implement PvP Talents (#19962)
* SPELL_AURA_119 -> SPELL_AURA_PVP_TALENTS * Learn Honorable Medallion when pvp rules are enabled
This commit is contained in:
@@ -51,6 +51,30 @@ void WorldSession::HandleLearnTalentsOpcode(WorldPackets::Talent::LearnTalents&
|
||||
_player->SendTalentsInfoData();
|
||||
}
|
||||
|
||||
void WorldSession::HandleLearnPvpTalentsOpcode(WorldPackets::Talent::LearnPvpTalents& packet)
|
||||
{
|
||||
WorldPackets::Talent::LearnPvpTalentsFailed learnPvpTalentsFailed;
|
||||
bool anythingLearned = false;
|
||||
for (uint32 talentId : packet.Talents)
|
||||
{
|
||||
if (TalentLearnResult result = _player->LearnPvpTalent(talentId, &learnPvpTalentsFailed.SpellID))
|
||||
{
|
||||
if (!learnPvpTalentsFailed.Reason)
|
||||
learnPvpTalentsFailed.Reason = result;
|
||||
|
||||
learnPvpTalentsFailed.Talents.push_back(talentId);
|
||||
}
|
||||
else
|
||||
anythingLearned = true;
|
||||
}
|
||||
|
||||
if (learnPvpTalentsFailed.Reason)
|
||||
SendPacket(learnPvpTalentsFailed.Write());
|
||||
|
||||
if (anythingLearned)
|
||||
_player->SendTalentsInfoData();
|
||||
}
|
||||
|
||||
void WorldSession::HandleConfirmRespecWipeOpcode(WorldPackets::Talent::ConfirmRespecWipe& confirmRespecWipe)
|
||||
{
|
||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(confirmRespecWipe.RespecMaster, UNIT_NPC_FLAG_TRAINER);
|
||||
|
||||
Reference in New Issue
Block a user