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:
Jeremy
2018-03-04 22:32:08 +01:00
committed by Shauren
parent e0eafc1cac
commit f411b7a90e
25 changed files with 670 additions and 11 deletions

View File

@@ -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);