Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 7.01 KB | None | 0 0
  1. diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
  2. index ac16c92..1517a56 100644
  3. --- a/src/server/game/Entities/Player/Player.cpp
  4. +++ b/src/server/game/Entities/Player/Player.cpp
  5. @@ -10240,36 +10240,6 @@ void Player::SetBindPoint(uint64 guid)
  6.      GetSession()->SendPacket(&data);
  7.  }
  8.  
  9. -void Player::SendTalentWipeConfirm(uint64 guid)
  10. -{
  11. -    ObjectGuid Guid = guid;
  12. -    uint8 RespecType = 0;
  13. -    uint32 Cost = sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : GetNextResetTalentsCost();
  14. -    WorldPacket data(SMSG_RESPEC_WIPE_CONFIRM, (8 + 1 + 4));
  15. -
  16. -    data.WriteBit(Guid[5]);
  17. -    data.WriteBit(Guid[7]);
  18. -    data.WriteBit(Guid[3]);
  19. -    data.WriteBit(Guid[2]);
  20. -    data.WriteBit(Guid[1]);
  21. -    data.WriteBit(Guid[0]);
  22. -    data.WriteBit(Guid[4]);
  23. -    data.WriteBit(Guid[6]);
  24. -
  25. -    data.WriteByteSeq(Guid[1]);
  26. -    data.WriteByteSeq(Guid[0]);
  27. -    data << uint8(RespecType);
  28. -    data.WriteByteSeq(Guid[7]);
  29. -    data.WriteByteSeq(Guid[3]);
  30. -    data.WriteByteSeq(Guid[2]);
  31. -    data.WriteByteSeq(Guid[5]);
  32. -    data.WriteByteSeq(Guid[6]);
  33. -    data.WriteByteSeq(Guid[4]);
  34. -    data << uint32(Cost);
  35. -
  36. -    GetSession()->SendPacket(&data);
  37. -}
  38. -
  39.  void Player::ResetPetTalents()
  40.  {
  41.      // This needs another gossip option + NPC text as a confirmation.
  42. @@ -15152,7 +15122,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
  43.              break;
  44.          case GOSSIP_OPTION_UNLEARNTALENTS:
  45.              PlayerTalkClass->SendCloseGossip();
  46. -            SendTalentWipeConfirm(guid);
  47. +            GetSession()->SendRespecWipeConfirm(guid, 0);
  48.              break;
  49.          case GOSSIP_OPTION_UNLEARNPETTALENTS:
  50.              PlayerTalkClass->SendCloseGossip();
  51.  
  52.  
  53. diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
  54. index b191ffb..b0bf95a 100644
  55. --- a/src/server/game/Entities/Player/Player.h
  56. +++ b/src/server/game/Entities/Player/Player.h
  57. @@ -1681,7 +1681,6 @@ class Player : public Unit, public GridObject<Player>
  58.          bool m_mailsUpdated;
  59.  
  60.          void SetBindPoint(uint64 guid);
  61. -        void SendTalentWipeConfirm(uint64 guid);
  62.          void ResetPetTalents();
  63.          void CalcRage(uint32 damage, bool attacker);
  64.          void RegenerateAll();
  65.  
  66.  
  67. diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
  68. index 0cc0ec8..0e0ee76 100644
  69. --- a/src/server/game/Handlers/SkillHandler.cpp
  70. +++ b/src/server/game/Handlers/SkillHandler.cpp
  71. @@ -82,7 +82,6 @@ void WorldSession::HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket)
  72.      TC_LOG_DEBUG("network", "CMSG_CONFIRM_RESPEC_WIPE");
  73.      ObjectGuid guid;
  74.      uint8 RespecType = 0;
  75. -    uint32 Cost = 0;
  76.  
  77.      recvPacket >> RespecType;
  78.      guid[2] = recvPacket.ReadBit();
  79. @@ -116,29 +115,7 @@ void WorldSession::HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket)
  80.  
  81.      if (!_player->ResetTalents())
  82.      {
  83. -        WorldPacket data(SMSG_RESPEC_WIPE_CONFIRM, 8 + 1 + 4);    //you have not any talent
  84. -
  85. -        data.WriteBit(guid[5]);
  86. -        data.WriteBit(guid[7]);
  87. -        data.WriteBit(guid[3]);
  88. -        data.WriteBit(guid[2]);
  89. -        data.WriteBit(guid[1]);
  90. -        data.WriteBit(guid[0]);
  91. -        data.WriteBit(guid[4]);
  92. -        data.WriteBit(guid[6]);
  93. -
  94. -        data.WriteByteSeq(guid[1]);
  95. -        data.WriteByteSeq(guid[0]);
  96. -        data << uint8(RespecType);
  97. -        data.WriteByteSeq(guid[7]);
  98. -        data.WriteByteSeq(guid[3]);
  99. -        data.WriteByteSeq(guid[2]);
  100. -        data.WriteByteSeq(guid[5]);
  101. -        data.WriteByteSeq(guid[6]);
  102. -        data.WriteByteSeq(guid[4]);
  103. -        data << uint32(Cost);
  104. -
  105. -        SendPacket(&data);
  106. +        SendRespecWipeConfirm(guid, RespecType);
  107.          return;
  108.      }
  109.  
  110. @@ -146,6 +123,34 @@ void WorldSession::HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket)
  111.      unit->CastSpell(_player, 14867, true);                  //spell: "Untalent Visual Effect"
  112.  }
  113.  
  114. +void WorldSession::SendRespecWipeConfirm(ObjectGuid RespecMaster, uint8 RespecType)
  115. +{
  116. +    uint32 Cost = 0;
  117. +    WorldPacket data(SMSG_RESPEC_WIPE_CONFIRM, 8 + 1 + 4);    //you have not any talent
  118. +
  119. +    data.WriteBit(RespecMaster[5]);
  120. +    data.WriteBit(RespecMaster[7]);
  121. +    data.WriteBit(RespecMaster[3]);
  122. +    data.WriteBit(RespecMaster[2]);
  123. +    data.WriteBit(RespecMaster[1]);
  124. +    data.WriteBit(RespecMaster[0]);
  125. +    data.WriteBit(RespecMaster[4]);
  126. +    data.WriteBit(RespecMaster[6]);
  127. +
  128. +    data.WriteByteSeq(RespecMaster[1]);
  129. +    data.WriteByteSeq(RespecMaster[0]);
  130. +    data << uint8(RespecType);
  131. +    data.WriteByteSeq(RespecMaster[7]);
  132. +    data.WriteByteSeq(RespecMaster[3]);
  133. +    data.WriteByteSeq(RespecMaster[2]);
  134. +    data.WriteByteSeq(RespecMaster[5]);
  135. +    data.WriteByteSeq(RespecMaster[6]);
  136. +    data.WriteByteSeq(RespecMaster[4]);
  137. +    data << uint32(Cost);
  138. +
  139. +    SendPacket(&data);
  140. +}
  141. +
  142.  void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recvData)
  143.  {
  144.      uint32 skillId;
  145.  
  146.  
  147. diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
  148. index 5bc4a4b..4407021 100644
  149. --- a/src/server/game/Server/WorldSession.h
  150. +++ b/src/server/game/Server/WorldSession.h
  151. @@ -702,6 +702,7 @@ class WorldSession
  152.          void HandleLearnTalentOpcode(WorldPacket& recvPacket);
  153.          void HandleLearnPreviewTalents(WorldPacket& recvPacket);
  154.          void HandleRespecWipeConfirmOpcode(WorldPacket& recvPacket);
  155. +        void SendRespecWipeConfirm(ObjectGuid RespecMaster, uint8 RespecType);
  156.          void HandleUnlearnSkillOpcode(WorldPacket& recvPacket);
  157.  
  158.          void HandleQuestgiverStatusQueryOpcode(WorldPacket& recvPacket);
  159.  
  160.  
  161. diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
  162. index 5fec0ad..5817922 100644
  163. --- a/src/server/game/Spells/SpellEffects.cpp
  164. +++ b/src/server/game/Spells/SpellEffects.cpp
  165. @@ -2544,7 +2544,7 @@ void Spell::EffectUntrainTalents(SpellEffIndex /*effIndex*/)
  166.          return;
  167.  
  168.      if (uint64 guid = m_caster->GetGUID()) // the trainer is the caster
  169. -        unitTarget->ToPlayer()->SendTalentWipeConfirm(guid);
  170. +        unitTarget->ToPlayer()->GetSession()->SendRespecWipeConfirm(guid, 0);
  171.  }
  172.  
  173.  void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex)
  174.  
  175.  
  176. diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
  177. index 2d262dc..f7e1a00 100644
  178. --- a/src/server/scripts/World/npcs_special.cpp
  179. +++ b/src/server/scripts/World/npcs_special.cpp
  180. @@ -1293,7 +1293,7 @@ public:
  181.                  break;
  182.              case GOSSIP_OPTION_UNLEARNTALENTS:
  183.                  player->CLOSE_GOSSIP_MENU();
  184. -                player->SendTalentWipeConfirm(creature->GetGUID());
  185. +                player->GetSession()->SendRespecWipeConfirm(creature->GetGUID(), 0);
  186.                  break;
  187.              case GOSSIP_OPTION_LEARNDUALSPEC:
  188.                  if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement