mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 04:37:02 +00:00
[12161] Update talents:
Fix talent learn Fix talent reset Fix talent inspecting original author: @Shauren Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
This commit is contained in:
parent
578c440902
commit
55ebf1b64f
16 changed files with 284 additions and 109 deletions
|
|
@ -27,18 +27,39 @@
|
|||
|
||||
void WorldSession::HandleLearnTalentOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG("CMSG_LEARN_PREVIEW_TALENTS");
|
||||
|
||||
uint32 talent_id, requested_rank;
|
||||
recv_data >> talent_id >> requested_rank;
|
||||
|
||||
_player->LearnTalent(talent_id, requested_rank);
|
||||
_player->SendTalentsInfoData(false);
|
||||
if (_player->LearnTalent(talent_id, requested_rank))
|
||||
_player->SendTalentsInfoData(false);
|
||||
else
|
||||
sLog.outError("WorldSession::HandleLearnTalentOpcode: learn talent %u rank %u failed for %s (account %u)", talent_id, requested_rank, GetPlayerName(), GetAccountId());
|
||||
}
|
||||
|
||||
void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
|
||||
{
|
||||
DEBUG_LOG("CMSG_LEARN_PREVIEW_TALENTS");
|
||||
|
||||
int32 tabPage;
|
||||
uint32 talentsCount;
|
||||
recvPacket >> tabPage; // talent tree
|
||||
|
||||
// prevent cheating (selecting new tree with points already in another)
|
||||
if (tabPage >= 0) // -1 if player already has specialization
|
||||
{
|
||||
if (TalentTabEntry const* talentTabEntry = sTalentTabStore.LookupEntry(_player->GetPrimaryTalentTree(_player->GetActiveSpec())))
|
||||
{
|
||||
if (talentTabEntry->tabpage != tabPage)
|
||||
{
|
||||
recvPacket.rfinish();
|
||||
sLog.outError("WorldSession::HandleLearnPreviewTalents: tabPage != talent tabPage for %s (account %u)", GetPlayerName(), GetAccountId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
recvPacket >> talentsCount;
|
||||
|
||||
uint32 talentId, talentRank;
|
||||
|
|
@ -47,7 +68,12 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
|
|||
{
|
||||
recvPacket >> talentId >> talentRank;
|
||||
|
||||
_player->LearnTalent(talentId, talentRank);
|
||||
if (!_player->LearnTalent(talentId, talentRank))
|
||||
{
|
||||
recvPacket.rfinish();
|
||||
sLog.outError("WorldSession::HandleLearnPreviewTalents: learn talent %u rank %u tab %u failed for %s (account %u)", talentId, talentRank, tabPage, GetPlayerName(), GetAccountId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_player->SendTalentsInfoData(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue