Core/Player: Implement PvP Talents
This commit is contained in:
@@ -2520,6 +2520,10 @@ namespace Game
|
||||
stmt.AddValue(0, lowGuid);
|
||||
SetQuery(PlayerLoginQueryLoad.Talents, stmt);
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_PVP_TALENTS);
|
||||
stmt.AddValue(0, lowGuid);
|
||||
SetQuery(PlayerLoginQueryLoad.PvpTalents, stmt);
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PLAYER_ACCOUNT_DATA);
|
||||
stmt.AddValue(0, lowGuid);
|
||||
SetQuery(PlayerLoginQueryLoad.AccountData, stmt);
|
||||
@@ -2615,6 +2619,7 @@ namespace Game
|
||||
BgData,
|
||||
Glyphs,
|
||||
Talents,
|
||||
PvpTalents,
|
||||
AccountData,
|
||||
Skills,
|
||||
WeeklyQuestStatus,
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace Game
|
||||
|
||||
player.SendPacket(packet);
|
||||
plTarget.SendPacket(packet);
|
||||
|
||||
player.EnablePvpRules();
|
||||
plTarget.EnablePvpRules();
|
||||
}
|
||||
|
||||
void HandleDuelCancelled()
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user