mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user