Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
- index ac16c92..1517a56 100644
- --- a/src/server/game/Entities/Player/Player.cpp
- +++ b/src/server/game/Entities/Player/Player.cpp
- @@ -10240,36 +10240,6 @@ void Player::SetBindPoint(uint64 guid)
- GetSession()->SendPacket(&data);
- }
- -void Player::SendTalentWipeConfirm(uint64 guid)
- -{
- - ObjectGuid Guid = guid;
- - uint8 RespecType = 0;
- - uint32 Cost = sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : GetNextResetTalentsCost();
- - WorldPacket data(SMSG_RESPEC_WIPE_CONFIRM, (8 + 1 + 4));
- -
- - data.WriteBit(Guid[5]);
- - data.WriteBit(Guid[7]);
- - data.WriteBit(Guid[3]);
- - data.WriteBit(Guid[2]);
- - data.WriteBit(Guid[1]);
- - data.WriteBit(Guid[0]);
- - data.WriteBit(Guid[4]);
- - data.WriteBit(Guid[6]);
- -
- - data.WriteByteSeq(Guid[1]);
- - data.WriteByteSeq(Guid[0]);
- - data << uint8(RespecType);
- - data.WriteByteSeq(Guid[7]);
- - data.WriteByteSeq(Guid[3]);
- - data.WriteByteSeq(Guid[2]);
- - data.WriteByteSeq(Guid[5]);
- - data.WriteByteSeq(Guid[6]);
- - data.WriteByteSeq(Guid[4]);
- - data << uint32(Cost);
- -
- - GetSession()->SendPacket(&data);
- -}
- -
- void Player::ResetPetTalents()
- {
- // This needs another gossip option + NPC text as a confirmation.
- @@ -15152,7 +15122,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
- break;
- case GOSSIP_OPTION_UNLEARNTALENTS:
- PlayerTalkClass->SendCloseGossip();
- - SendTalentWipeConfirm(guid);
- + GetSession()->SendRespecWipeConfirm(guid, 0);
- break;
- case GOSSIP_OPTION_UNLEARNPETTALENTS:
- PlayerTalkClass->SendCloseGossip();
- diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
- index b191ffb..b0bf95a 100644
- --- a/src/server/game/Entities/Player/Player.h
- +++ b/src/server/game/Entities/Player/Player.h
- @@ -1681,7 +1681,6 @@ class Player : public Unit, public GridObject<Player>
- bool m_mailsUpdated;
- void SetBindPoint(uint64 guid);
- - void SendTalentWipeConfirm(uint64 guid);
- void ResetPetTalents();
- void CalcRage(uint32 damage, bool attacker);
- void RegenerateAll();
- diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
- index 0cc0ec8..0e0ee76 100644
- --- a/src/server/game/Handlers/SkillHandler.cpp
- +++ b/src/server/game/Handlers/SkillHandler.cpp
- @@ -82,7 +82,6 @@ void WorldSession::HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket)
- TC_LOG_DEBUG("network", "CMSG_CONFIRM_RESPEC_WIPE");
- ObjectGuid guid;
- uint8 RespecType = 0;
- - uint32 Cost = 0;
- recvPacket >> RespecType;
- guid[2] = recvPacket.ReadBit();
- @@ -116,29 +115,7 @@ void WorldSession::HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket)
- if (!_player->ResetTalents())
- {
- - WorldPacket data(SMSG_RESPEC_WIPE_CONFIRM, 8 + 1 + 4); //you have not any talent
- -
- - data.WriteBit(guid[5]);
- - data.WriteBit(guid[7]);
- - data.WriteBit(guid[3]);
- - data.WriteBit(guid[2]);
- - data.WriteBit(guid[1]);
- - data.WriteBit(guid[0]);
- - data.WriteBit(guid[4]);
- - data.WriteBit(guid[6]);
- -
- - data.WriteByteSeq(guid[1]);
- - data.WriteByteSeq(guid[0]);
- - data << uint8(RespecType);
- - data.WriteByteSeq(guid[7]);
- - data.WriteByteSeq(guid[3]);
- - data.WriteByteSeq(guid[2]);
- - data.WriteByteSeq(guid[5]);
- - data.WriteByteSeq(guid[6]);
- - data.WriteByteSeq(guid[4]);
- - data << uint32(Cost);
- -
- - SendPacket(&data);
- + SendRespecWipeConfirm(guid, RespecType);
- return;
- }
- @@ -146,6 +123,34 @@ void WorldSession::HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket)
- unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect"
- }
- +void WorldSession::SendRespecWipeConfirm(ObjectGuid RespecMaster, uint8 RespecType)
- +{
- + uint32 Cost = 0;
- + WorldPacket data(SMSG_RESPEC_WIPE_CONFIRM, 8 + 1 + 4); //you have not any talent
- +
- + data.WriteBit(RespecMaster[5]);
- + data.WriteBit(RespecMaster[7]);
- + data.WriteBit(RespecMaster[3]);
- + data.WriteBit(RespecMaster[2]);
- + data.WriteBit(RespecMaster[1]);
- + data.WriteBit(RespecMaster[0]);
- + data.WriteBit(RespecMaster[4]);
- + data.WriteBit(RespecMaster[6]);
- +
- + data.WriteByteSeq(RespecMaster[1]);
- + data.WriteByteSeq(RespecMaster[0]);
- + data << uint8(RespecType);
- + data.WriteByteSeq(RespecMaster[7]);
- + data.WriteByteSeq(RespecMaster[3]);
- + data.WriteByteSeq(RespecMaster[2]);
- + data.WriteByteSeq(RespecMaster[5]);
- + data.WriteByteSeq(RespecMaster[6]);
- + data.WriteByteSeq(RespecMaster[4]);
- + data << uint32(Cost);
- +
- + SendPacket(&data);
- +}
- +
- void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recvData)
- {
- uint32 skillId;
- diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
- index 5bc4a4b..4407021 100644
- --- a/src/server/game/Server/WorldSession.h
- +++ b/src/server/game/Server/WorldSession.h
- @@ -702,6 +702,7 @@ class WorldSession
- void HandleLearnTalentOpcode(WorldPacket& recvPacket);
- void HandleLearnPreviewTalents(WorldPacket& recvPacket);
- void HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket);
- + void SendRespecWipeConfirm(ObjectGuid RespecMaster, uint8 RespecType);
- void HandleUnlearnSkillOpcode(WorldPacket& recvPacket);
- void HandleQuestgiverStatusQueryOpcode(WorldPacket& recvPacket);
- diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
- index 5fec0ad..5817922 100644
- --- a/src/server/game/Spells/SpellEffects.cpp
- +++ b/src/server/game/Spells/SpellEffects.cpp
- @@ -2544,7 +2544,7 @@ void Spell::EffectUntrainTalents(SpellEffIndex /*effIndex*/)
- return;
- if (uint64 guid = m_caster->GetGUID()) // the trainer is the caster
- - unitTarget->ToPlayer()->SendTalentWipeConfirm(guid);
- + unitTarget->ToPlayer()->GetSession()->SendRespecWipeConfirm(guid, 0);
- }
- void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex)
- diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
- index 2d262dc..f7e1a00 100644
- --- a/src/server/scripts/World/npcs_special.cpp
- +++ b/src/server/scripts/World/npcs_special.cpp
- @@ -1293,7 +1293,7 @@ public:
- break;
- case GOSSIP_OPTION_UNLEARNTALENTS:
- player->CLOSE_GOSSIP_MENU();
- - player->SendTalentWipeConfirm(creature->GetGUID());
- + player->GetSession()->SendRespecWipeConfirm(creature->GetGUID(), 0);
- break;
- case GOSSIP_OPTION_LEARNDUALSPEC:
- if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement