diff options
| author | Mykhailo Redko <ovitnez@gmail.com> | 2024-02-13 16:55:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-13 15:55:37 +0100 |
| commit | ca1560f043df275d9241055adbf61a393666a533 (patch) | |
| tree | 594263c2cce9d067bc9e550e785c355740ecf465 /src/server/scripts/Commands | |
| parent | 1b878209354723138d2f5d969ee53255e6db94d4 (diff) | |
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.
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_reset.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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; |
