aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/3.3.5/2024_02_13_00_world.sql2
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp14
-rw-r--r--src/server/game/Entities/Pet/Pet.h4
-rw-r--r--src/server/game/Entities/Player/Player.cpp61
-rw-r--r--src/server/game/Entities/Player/Player.h5
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp3
-rw-r--r--src/server/game/Handlers/SkillHandler.cpp29
-rw-r--r--src/server/game/Miscellaneous/Language.h4
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp6
-rw-r--r--src/server/game/Scripting/ScriptMgr.h4
-rw-r--r--src/server/game/Server/Packets/AllPackets.h3
-rw-r--r--src/server/game/Server/Packets/TalentPackets.cpp41
-rw-r--r--src/server/game/Server/Packets/TalentPackets.h59
-rw-r--r--src/server/game/Server/Protocol/Opcodes.h2
-rw-r--r--src/server/game/Server/WorldSession.h12
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp6
16 files changed, 180 insertions, 75 deletions
diff --git a/sql/updates/world/3.3.5/2024_02_13_00_world.sql b/sql/updates/world/3.3.5/2024_02_13_00_world.sql
new file mode 100644
index 00000000000..e56e9a09ef2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2024_02_13_00_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `trinity_string` WHERE `entry` IN (216, 1126);
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 1b26f6a4f82..3ede7366b9b 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -32,6 +32,7 @@
#include "SpellHistory.h"
#include "SpellMgr.h"
#include "SpellPackets.h"
+#include "TalentPackets.h"
#include "Unit.h"
#include "Util.h"
#include "WorldPacket.h"
@@ -1642,7 +1643,7 @@ void Pet::InitPetCreateSpells()
CastPetAuras(false);
}
-bool Pet::resetTalents()
+bool Pet::resetTalents(bool involuntarily /*= false*/)
{
Player* player = GetOwner();
@@ -1712,10 +1713,14 @@ bool Pet::resetTalents()
if (!m_loading)
player->PetSpellInitialize();
+
+ if (involuntarily)
+ player->SendDirectMessage(WorldPackets::Talents::InvoluntarilyReset(true).Write());
+
return true;
}
-void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* onlinePet /*= nullptr*/)
+void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* onlinePet /*= nullptr*/, bool involuntarily /*= false*/)
{
// not need after this call
if (owner->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
@@ -1723,7 +1728,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* onlinePet /*= nullptr*/)
// reset for online
if (onlinePet)
- onlinePet->resetTalents();
+ onlinePet->resetTalents(involuntarily);
PetStable* petStable = owner->GetPetStable();
if (!petStable)
@@ -1748,6 +1753,9 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* onlinePet /*= nullptr*/)
if (petIds.empty())
return;
+ if (!onlinePet)
+ owner->SendDirectMessage(WorldPackets::Talents::InvoluntarilyReset(true).Write());
+
bool need_comma = false;
std::ostringstream ss;
ss << "DELETE FROM pet_spell WHERE guid IN (";
diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h
index 7828cdc23cb..790e6e118c2 100644
--- a/src/server/game/Entities/Pet/Pet.h
+++ b/src/server/game/Entities/Pet/Pet.h
@@ -130,8 +130,8 @@ class TC_GAME_API Pet : public Guardian
void InitPetCreateSpells();
- bool resetTalents();
- static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = nullptr);
+ bool resetTalents(bool involuntarily = false);
+ static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = nullptr, bool involuntarily = false);
void InitTalentForLevel();
uint8 GetMaxTalentPointsForLevel(uint8 level) const;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index df065ff6331..8603de75288 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -90,6 +90,7 @@
#include "SpellMgr.h"
#include "SpellPackets.h"
#include "StringConvert.h"
+#include "TalentPackets.h"
#include "TicketMgr.h"
#include "TradeData.h"
#include "Trainer.h"
@@ -2681,7 +2682,7 @@ void Player::InitTalentForLevel()
// Remove all talent points
if (m_usedTalentCount > 0) // Free any used talents
{
- ResetTalents(true); /// @todo: Has to (collectively) be renamed to ResetTalents
+ ResetTalents(true);
SetFreeTalentPoints(0);
}
}
@@ -3835,6 +3836,9 @@ void Player::RemoveArenaSpellCooldowns(bool removeActivePetCooldowns)
uint32 Player::ResetTalentsCost() const
{
+ if (sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST))
+ return 0;
+
// The first time reset costs 1 gold
if (m_resetTalentsCost < 1*GOLD)
return 1*GOLD;
@@ -3866,9 +3870,20 @@ uint32 Player::ResetTalentsCost() const
}
}
-bool Player::ResetTalents(bool no_cost)
+void Player::IncreaseResetTalentsCostAndCounters(uint32 lastResetTalentsCost)
+{
+ if (lastResetTalentsCost > 0) // We don't want to reset the accumulated talent reset cost if we decide to temporarily enable CONFIG_NO_RESET_TALENT_COST
+ m_resetTalentsCost = lastResetTalentsCost;
+
+ m_resetTalentsTime = GameTime::GetGameTime();
+
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, lastResetTalentsCost);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1);
+}
+
+bool Player::ResetTalents(bool involuntarily /*= false*/)
{
- sScriptMgr->OnPlayerTalentsReset(this, no_cost);
+ sScriptMgr->OnPlayerTalentsReset(this, involuntarily);
// not need after this call
if (HasAtLoginFlag(AT_LOGIN_RESET_TALENTS))
@@ -3882,19 +3897,6 @@ bool Player::ResetTalents(bool no_cost)
return false;
}
- uint32 cost = 0;
-
- if (!no_cost && !sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST))
- {
- cost = ResetTalentsCost();
-
- if (!HasEnoughMoney(cost))
- {
- SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, nullptr, 0, 0);
- return false;
- }
- }
-
RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
@@ -3942,23 +3944,8 @@ bool Player::ResetTalents(bool no_cost)
SetFreeTalentPoints(talentPointsForLevel);
- if (!no_cost)
- {
- ModifyMoney(-(int32)cost);
- UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost);
- UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1);
-
- m_resetTalentsCost = cost;
- m_resetTalentsTime = GameTime::GetGameTime();
- }
-
- /* when prev line will dropped use next line
- if (Pet* pet = GetPet())
- {
- if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureTemplate()->IsTameable(CanTameExoticPets()))
- RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
- }
- */
+ if (involuntarily)
+ SendDirectMessage(WorldPackets::Talents::InvoluntarilyReset(false).Write());
return true;
}
@@ -9436,13 +9423,9 @@ void Player::SetBindPoint(ObjectGuid guid) const
SendDirectMessage(packet.Write());
}
-void Player::SendTalentWipeConfirm(ObjectGuid guid) const
+void Player::SendTalentWipeConfirm(ObjectGuid trainerGuid) const
{
- WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4));
- data << uint64(guid);
- uint32 cost = sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : ResetTalentsCost();
- data << cost;
- SendDirectMessage(&data);
+ SendDirectMessage(WorldPackets::Talents::RespecWipeConfirm(trainerGuid, ResetTalentsCost()).Write());
}
void Player::ResetPetTalents()
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 5c97be882b7..45ec314f4da 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1359,7 +1359,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool m_mailsUpdated;
void SetBindPoint(ObjectGuid guid) const;
- void SendTalentWipeConfirm(ObjectGuid guid) const;
+ void SendTalentWipeConfirm(ObjectGuid trainerGuid) const;
void ResetPetTalents();
void RegenerateAll();
void Regenerate(Powers power);
@@ -1445,8 +1445,9 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
std::string const& GetGuildName() const;
uint32 GetFreeTalentPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS1); }
void SetFreeTalentPoints(uint32 points);
- bool ResetTalents(bool no_cost = false);
+ bool ResetTalents(bool involuntarily = false);
uint32 ResetTalentsCost() const;
+ void IncreaseResetTalentsCostAndCounters(uint32 lastResetTalentsCost);
void InitTalentForLevel();
void BuildPlayerTalentsInfoData(WorldPacket* data);
void BuildPetTalentsInfoData(WorldPacket* data);
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 93b8aa3be17..0e4a1bcd1e4 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -877,7 +877,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder)
// reset for all pets before pet loading
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
- Pet::resetTalentsForAllPetsOf(pCurrChar);
+ Pet::resetTalentsForAllPetsOf(pCurrChar, nullptr, true);
// Load pet if any (if player not alive and in taxi flight or another then pet will remember as temporary unsummoned)
pCurrChar->LoadPet();
@@ -900,7 +900,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder)
{
pCurrChar->ResetTalents(true);
pCurrChar->SendTalentsInfoData(false); // original talents send already in to SendInitialPacketsBeforeAddToMap, resend reset state
- SendNotification(LANG_RESET_TALENTS);
}
bool firstLogin = pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST);
diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
index a43cfdecd13..178237924eb 100644
--- a/src/server/game/Handlers/SkillHandler.cpp
+++ b/src/server/game/Handlers/SkillHandler.cpp
@@ -22,6 +22,7 @@
#include "ObjectAccessor.h"
#include "Pet.h"
#include "Player.h"
+#include "TalentPackets.h"
#include "WorldPacket.h"
void WorldSession::HandleLearnTalentOpcode(WorldPacket& recvData)
@@ -57,37 +58,39 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
recvPacket.rfinish();
}
-void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recvData)
+void WorldSession::HandleTalentWipeConfirmOpcode(WorldPackets::Talents::ConfirmRespecWipe& confirmRespecWipe)
{
TC_LOG_DEBUG("network", "MSG_TALENT_WIPE_CONFIRM");
- ObjectGuid guid;
- recvData >> guid;
- Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
- if (!unit)
+ Creature* trainer = GetPlayer()->GetNPCIfCanInteractWith(confirmRespecWipe.RespecMaster, UNIT_NPC_FLAG_TRAINER);
+ if (!trainer)
{
- TC_LOG_DEBUG("network", "WORLD: HandleTalentWipeConfirmOpcode - {} not found or you can't interact with him.", guid.ToString());
+ TC_LOG_DEBUG("network", "WORLD: HandleTalentWipeConfirmOpcode - {} not found or you can't interact with him.", confirmRespecWipe.RespecMaster);
return;
}
- if (!unit->CanResetTalents(_player, false))
+ if (!trainer->CanResetTalents(_player, false))
return;
+ uint32 cost = _player->ResetTalentsCost();
+ if (!_player->HasEnoughMoney(cost))
+ return; // // silently return, client should display the error by itself
+
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- if (!(_player->ResetTalents()))
+ if (!_player->ResetTalents())
{
- WorldPacket data(MSG_TALENT_WIPE_CONFIRM, 8+4); //you have not any talent
- data << uint64(0);
- data << uint32(0);
- SendPacket(&data);
+ _player->SendTalentWipeConfirm(ObjectGuid::Empty);
return;
}
+ _player->ModifyMoney(-(int32)cost);
+ _player->IncreaseResetTalentsCostAndCounters(cost);
_player->SendTalentsInfoData(false);
- unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect"
+
+ trainer->CastSpell(_player, 14867 /*SPELL_UNTALENT_VISUAL_EFFECT*/, true);
}
void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recvData)
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 725bdd7d672..073c0294f71 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -258,7 +258,7 @@ enum TrinityStrings
LANG_RESET_TALENTS_ONLINE = 213,
LANG_RESET_TALENTS_OFFLINE = 214,
LANG_RESET_SPELLS = 215,
- LANG_RESET_TALENTS = 216,
+ // unused = 216,
LANG_RESETALL_UNKNOWN_CASE = 217,
LANG_RESETALL_SPELLS = 218,
@@ -897,7 +897,7 @@ enum TrinityStrings
LANG_NO_PET_FOUND = 1123,
LANG_WRONG_PET_TYPE = 1124,
LANG_COMMAND_LEARN_PET_TALENTS = 1125,
- LANG_RESET_PET_TALENTS = 1126,
+ // unused = 1126,
LANG_RESET_PET_TALENTS_ONLINE = 1127,
LANG_TAXINODE_ENTRY_LIST_CHAT = 1128,
LANG_TAXINODE_ENTRY_LIST_CONSOLE = 1129,
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 3252ca8d893..b35aa9760b7 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -1843,9 +1843,9 @@ void ScriptMgr::OnPlayerFreeTalentPointsChanged(Player* player, uint32 points)
FOREACH_SCRIPT(PlayerScript)->OnFreeTalentPointsChanged(player, points);
}
-void ScriptMgr::OnPlayerTalentsReset(Player* player, bool noCost)
+void ScriptMgr::OnPlayerTalentsReset(Player* player, bool involuntarily)
{
- FOREACH_SCRIPT(PlayerScript)->OnTalentsReset(player, noCost);
+ FOREACH_SCRIPT(PlayerScript)->OnTalentsReset(player, involuntarily);
}
void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount)
@@ -2591,7 +2591,7 @@ void PlayerScript::OnFreeTalentPointsChanged(Player* /*player*/, uint32 /*points
{
}
-void PlayerScript::OnTalentsReset(Player* /*player*/, bool /*noCost*/)
+void PlayerScript::OnTalentsReset(Player* /*player*/, bool /*involuntarily*/)
{
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index d43b8e1c8b8..e329fbaeeb3 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -641,7 +641,7 @@ class TC_GAME_API PlayerScript : public ScriptObject
virtual void OnFreeTalentPointsChanged(Player* player, uint32 points);
// Called when a player's talent points are reset (right before the reset is done)
- virtual void OnTalentsReset(Player* player, bool noCost);
+ virtual void OnTalentsReset(Player* player, bool involuntarily);
// Called when a player's money is modified (before the modification is done)
virtual void OnMoneyChanged(Player* player, int32& amount);
@@ -1009,7 +1009,7 @@ class TC_GAME_API ScriptMgr
void OnPlayerKilledByCreature(Creature* killer, Player* killed);
void OnPlayerLevelChanged(Player* player, uint8 oldLevel);
void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints);
- void OnPlayerTalentsReset(Player* player, bool noCost);
+ void OnPlayerTalentsReset(Player* player, bool involuntarily);
void OnPlayerMoneyChanged(Player* player, int32& amount);
void OnPlayerMoneyLimit(Player* player, int32 amount);
void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim);
diff --git a/src/server/game/Server/Packets/AllPackets.h b/src/server/game/Server/Packets/AllPackets.h
index 1c4d55272ff..005b4884702 100644
--- a/src/server/game/Server/Packets/AllPackets.h
+++ b/src/server/game/Server/Packets/AllPackets.h
@@ -26,14 +26,15 @@
#include "CombatPackets.h"
#include "GuildPackets.h"
#include "LFGPackets.h"
-#include "NPCPackets.h"
#include "MailPackets.h"
#include "MiscPackets.h"
+#include "NPCPackets.h"
#include "PetPackets.h"
#include "QueryPackets.h"
#include "QuestPackets.h"
#include "SpellPackets.h"
#include "SystemPackets.h"
+#include "TalentPackets.h"
#include "TotemPackets.h"
#include "WorldStatePackets.h"
diff --git a/src/server/game/Server/Packets/TalentPackets.cpp b/src/server/game/Server/Packets/TalentPackets.cpp
new file mode 100644
index 00000000000..b1e496cbebf
--- /dev/null
+++ b/src/server/game/Server/Packets/TalentPackets.cpp
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * 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"
+
+namespace WorldPackets::Talents
+{
+WorldPacket const* RespecWipeConfirm::Write()
+{
+ _worldPacket << RespecMaster;
+ _worldPacket << uint32(Cost);
+
+ return &_worldPacket;
+}
+
+void ConfirmRespecWipe::Read()
+{
+ _worldPacket >> RespecMaster;
+}
+
+WorldPacket const* InvoluntarilyReset::Write()
+{
+ _worldPacket << uint8(IsPetTalents);
+
+ return &_worldPacket;
+}
+}
diff --git a/src/server/game/Server/Packets/TalentPackets.h b/src/server/game/Server/Packets/TalentPackets.h
new file mode 100644
index 00000000000..a2ee0653ca6
--- /dev/null
+++ b/src/server/game/Server/Packets/TalentPackets.h
@@ -0,0 +1,59 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * 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/>.
+ */
+
+#ifndef TalentPackets_h__
+#define TalentPackets_h__
+
+#include "ObjectGuid.h"
+#include "Packet.h"
+
+namespace WorldPackets::Talents
+{
+class RespecWipeConfirm final : public ServerPacket
+{
+public:
+ explicit RespecWipeConfirm(ObjectGuid respecMaster, uint32 cost)
+ : ServerPacket(MSG_TALENT_WIPE_CONFIRM, 8 + 4), RespecMaster(respecMaster), Cost(cost) { }
+
+ WorldPacket const* Write() override;
+
+ ObjectGuid RespecMaster;
+ uint32 Cost = 0;
+};
+
+class ConfirmRespecWipe final : public ClientPacket
+{
+public:
+ explicit ConfirmRespecWipe(WorldPacket&& packet) : ClientPacket(MSG_TALENT_WIPE_CONFIRM, std::move(packet)) { }
+
+ void Read() override;
+
+ ObjectGuid RespecMaster;
+};
+
+class InvoluntarilyReset final : public ServerPacket
+{
+public:
+ explicit InvoluntarilyReset(bool isPetTalents) : ServerPacket(SMSG_TALENTS_INVOLUNTARILY_RESET, 1), IsPetTalents(isPetTalents ? 1 : 0) { }
+
+ WorldPacket const* Write() override;
+
+ uint8 IsPetTalents = 0;
+};
+}
+
+#endif // TalentPackets_h__
diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h
index 38cc24128c1..47d62640a62 100644
--- a/src/server/game/Server/Protocol/Opcodes.h
+++ b/src/server/game/Server/Protocol/Opcodes.h
@@ -1300,7 +1300,7 @@ enum Opcodes : uint16
SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F7,
CMSG_CHAR_RACE_CHANGE = 0x4F8,
MSG_VIEW_PHASE_SHIFT = 0x4F9,
- SMSG_TALENTS_INVOLUNTARILY_RESET = 0x4FA, // uint8
+ SMSG_TALENTS_INVOLUNTARILY_RESET = 0x4FA, // uint8 (0 - player talents, 1 - player pet talents)
CMSG_DEBUG_SERVER_GEO = 0x4FB,
SMSG_DEBUG_SERVER_GEO = 0x4FC,
SMSG_LOOT_SLOT_CHANGED = 0x4FD,
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 7d3ee54ba5f..5b367defd57 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -122,12 +122,14 @@ namespace WorldPackets
{
class EmoteClient;
}
+
namespace Combat
{
class AttackSwing;
class AttackStop;
class SetSheathed;
}
+
namespace Guild
{
class QueryGuildInfo;
@@ -220,10 +222,12 @@ namespace WorldPackets
class QueryItemSingle;
class QuestPOIQuery;
}
+
namespace Quest
{
class QueryQuestInfo;
}
+
namespace Spells
{
class CancelCast;
@@ -234,6 +238,12 @@ namespace WorldPackets
class CancelAutoRepeatSpell;
class CancelChannelling;
}
+
+ namespace Talents
+ {
+ class ConfirmRespecWipe;
+ }
+
namespace Totem
{
class TotemDestroyed;
@@ -906,7 +916,7 @@ class TC_GAME_API WorldSession
void HandleLearnTalentOpcode(WorldPacket& recvPacket);
void HandleLearnPreviewTalents(WorldPacket& recvPacket);
- void HandleTalentWipeConfirmOpcode(WorldPacket& recvPacket);
+ void HandleTalentWipeConfirmOpcode(WorldPackets::Talents::ConfirmRespecWipe& confirmRespecWipe);
void HandleUnlearnSkillOpcode(WorldPacket& recvPacket);
void HandleQuestgiverStatusQueryOpcode(WorldPacket& recvPacket);
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index 0680f7985b5..3b357fcde23 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -223,10 +223,9 @@ public:
Unit* owner = creature->GetOwner();
if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer()))
{
- creature->ToPet()->resetTalents();
+ creature->ToPet()->resetTalents(true);
owner->ToPlayer()->SendTalentsInfoData(true);
- ChatHandler(owner->ToPlayer()->GetSession()).SendSysMessage(LANG_RESET_PET_TALENTS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != owner->ToPlayer())
handler->PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, handler->GetNameLink(owner->ToPlayer()).c_str());
}
@@ -242,12 +241,11 @@ public:
{
target->ResetTalents(true);
target->SendTalentsInfoData(false);
- ChatHandler(target->GetSession()).SendSysMessage(LANG_RESET_TALENTS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(target).c_str());
Pet* pet = target->GetPet();
- Pet::resetTalentsForAllPetsOf(target, pet);
+ Pet::resetTalentsForAllPetsOf(target, pet, true);
if (pet)
target->SendTalentsInfoData(true);
return true;