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.
This commit is contained in:
Mykhailo Redko
2024-02-13 16:55:37 +02:00
committed by GitHub
parent 1b87820935
commit ca1560f043
16 changed files with 180 additions and 75 deletions

View File

@@ -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*/)
{
}