Core/Players: Improvements for talent reset logic. (#29580)

* Clean up Player::ResetTalents() from unnecessary logic, such as withdrawing money. Move it to more suitable places.
* Implemented SMSG_TALENTS_INVOLUNTARILY_RESET and use it instead of old trinity_string.
* Do not reset the accumulated talent reset cost if CONFIG_NO_RESET_TALENT_COST is enabled.

(cherry picked from commit ca1560f043df275d9241055adbf61a393666a533)
This commit is contained in:
Mykhailo Redko
2026-05-26 23:08:28 +02:00
committed by Shauren
parent 65b857eb27
commit 0ecd978f81
12 changed files with 62 additions and 49 deletions
+3 -3
View File
@@ -2017,9 +2017,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, int64& amount)
@@ -2914,7 +2914,7 @@ void PlayerScript::OnFreeTalentPointsChanged(Player* /*player*/, uint32 /*points
{
}
void PlayerScript::OnTalentsReset(Player* /*player*/, bool /*noCost*/)
void PlayerScript::OnTalentsReset(Player* /*player*/, bool /*involuntarily*/)
{
}