2014-11-12 03:58:17 +02:00
|
|
|
/*
|
2016-01-01 00:34:25 +01:00
|
|
|
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
2014-11-12 03:58:17 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
|
* option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
|
* more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "TalentPackets.h"
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Talent::UpdateTalentData::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Info.ActiveGroup;
|
|
|
|
|
_worldPacket << uint32(Info.TalentGroups.size());
|
|
|
|
|
|
|
|
|
|
for (auto& talentGroupInfo : Info.TalentGroups)
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << talentGroupInfo.SpecID;
|
|
|
|
|
_worldPacket << uint32(talentGroupInfo.TalentIDs.size());
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
|
|
|
|
|
_worldPacket << talentGroupInfo.GlyphIDs[i];
|
|
|
|
|
|
|
|
|
|
for (uint16 talentID : talentGroupInfo.TalentIDs)
|
|
|
|
|
_worldPacket << talentID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2014-11-16 00:05:42 +02:00
|
|
|
|
|
|
|
|
void WorldPackets::Talent::SetSpecialization::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> SpecGroupIndex;
|
|
|
|
|
}
|
2014-12-04 19:23:35 +01:00
|
|
|
|
|
|
|
|
|
2015-01-18 23:56:01 +01:00
|
|
|
void WorldPackets::Talent::LearnTalents::Read()
|
2014-12-04 19:23:35 +01:00
|
|
|
{
|
|
|
|
|
uint32 count;
|
|
|
|
|
_worldPacket >> count;
|
2014-12-29 16:54:54 +01:00
|
|
|
|
2014-12-04 19:23:35 +01:00
|
|
|
for (uint32 i = 0; i < count; ++i)
|
|
|
|
|
{
|
|
|
|
|
uint16 talent;
|
|
|
|
|
_worldPacket >> talent;
|
|
|
|
|
Talents.push_back(talent);
|
|
|
|
|
}
|
|
|
|
|
}
|