Learn preview talents fix

This commit is contained in:
tomrus88 2009-03-05 14:44:40 +03:00
parent 49322fa20a
commit 329b06d1e3
6 changed files with 139 additions and 35 deletions

View file

@ -510,6 +510,7 @@ void WorldSession::HandlePetUnlearnOpcode(WorldPacket& recvPacket)
return;
}
pet->resetTalents();
_player->SendTalentsInfoData(true);
}
void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
@ -669,4 +670,31 @@ void WorldSession::HandlePetLearnTalent( WorldPacket & recv_data )
recv_data >> guid >> talent_id >> requested_rank;
_player->LearnPetTalent(guid, talent_id, requested_rank);
_player->SendTalentsInfoData(true);
}
void WorldSession::HandleLearnPreviewTalentsPet( WorldPacket & recv_data )
{
sLog.outDebug("CMSG_LEARN_PREVIEW_TALENTS_PET");
CHECK_PACKET_SIZE(recv_data, 8+4);
uint64 guid;
recv_data >> guid;
uint32 talentsCount;
recv_data >> talentsCount;
uint32 talentId, talentRank;
for(uint32 i = 0; i < talentsCount; ++i)
{
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4+4);
recv_data >> talentId >> talentRank;
_player->LearnPetTalent(guid, talentId, talentRank, true);
}
_player->SendTalentsInfoData(true);
}