diff options
Diffstat (limited to 'src/game/SkillHandler.cpp')
-rw-r--r-- | src/game/SkillHandler.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/SkillHandler.cpp b/src/game/SkillHandler.cpp index 949cb33a656..e8ee75ab86b 100644 --- a/src/game/SkillHandler.cpp +++ b/src/game/SkillHandler.cpp @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "Common.h" #include "Database/DatabaseEnv.h" #include "Opcodes.h" @@ -26,40 +27,52 @@ #include "WorldSession.h" #include "ObjectAccessor.h" #include "UpdateMask.h" + void WorldSession::HandleLearnTalentOpcode( WorldPacket & recv_data ) { uint32 talent_id, requested_rank; recv_data >> talent_id >> requested_rank; + _player->LearnTalent(talent_id, requested_rank); _player->SendTalentsInfoData(false); } + void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { sLog.outDebug("CMSG_LEARN_PREVIEW_TALENTS"); + uint32 talentsCount; recvPacket >> talentsCount; + uint32 talentId, talentRank; + for(uint32 i = 0; i < talentsCount; ++i) { recvPacket >> talentId >> talentRank; + _player->LearnTalent(talentId, talentRank); } + _player->SendTalentsInfoData(false); } + void WorldSession::HandleTalentWipeConfirmOpcode( WorldPacket & recv_data ) { sLog.outDetail("MSG_TALENT_WIPE_CONFIRM"); uint64 guid; recv_data >> guid; + Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TRAINER); if (!unit) { sLog.outDebug( "WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) ); return; } + // remove fake death if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); + if(!(_player->resetTalents())) { WorldPacket data( MSG_TALENT_WIPE_CONFIRM, 8+4); //you have not any talent @@ -68,9 +81,11 @@ void WorldSession::HandleTalentWipeConfirmOpcode( WorldPacket & recv_data ) SendPacket( &data ); return; } + _player->SendTalentsInfoData(false); unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect" } + void WorldSession::HandleUnlearnSkillOpcode(WorldPacket & recv_data) { uint32 skill_id; |