Core/Player: Implement PvP Talents

This commit is contained in:
hondacrx
2018-03-06 11:10:51 -05:00
parent 42fc86c400
commit c842332393
26 changed files with 631 additions and 68 deletions
+26
View File
@@ -52,6 +52,32 @@ namespace Game
GetPlayer().SendTalentsInfoData();
}
[WorldPacketHandler(ClientOpcodes.LearnPvpTalents)]
void HandleLearnPvpTalentsOpcode(LearnPvpTalents packet)
{
LearnPvpTalentsFailed learnPvpTalentsFailed = new LearnPvpTalentsFailed();
bool anythingLearned = false;
foreach (ushort talentId in packet.Talents)
{
TalentLearnResult result = _player.LearnPvpTalent(talentId, ref learnPvpTalentsFailed.SpellID);
if (result != 0)
{
if (learnPvpTalentsFailed.Reason == 0)
learnPvpTalentsFailed.Reason = (uint)result;
learnPvpTalentsFailed.Talents.Add(talentId);
}
else
anythingLearned = true;
}
if (learnPvpTalentsFailed.Reason != 0)
SendPacket(learnPvpTalentsFailed);
if (anythingLearned)
_player.SendTalentsInfoData();
}
[WorldPacketHandler(ClientOpcodes.ConfirmRespecWipe)]
void HandleConfirmRespecWipe(ConfirmRespecWipe confirmRespecWipe)
{