[Feature] Implement Custom Pet Names (#4594)

* rebase\tidy up to address commends

* I blame git for this one

* last typo

* spaces

* formating fixes I think?

* Repository fixes

* Cleanup

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
catapultam-habeo
2025-01-22 03:31:05 -06:00
committed by GitHub
parent 0acad18067
commit 31abaf8016
16 changed files with 595 additions and 10 deletions
+7
View File
@@ -22,6 +22,7 @@
#include "../common/repositories/pets_repository.h"
#include "../common/repositories/pets_beastlord_data_repository.h"
#include "../common/repositories/character_pet_name_repository.h"
#include "entity.h"
#include "client.h"
@@ -164,6 +165,12 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
// 4 - Keep DB name
// 5 - `s ward
if (IsClient() && !petname) {
const auto vanity_name = CharacterPetNameRepository::FindOne(database, CastToClient()->CharacterID());
if (!vanity_name.name.empty()) {
petname = vanity_name.name.c_str();
}
}
if (petname != nullptr) {
// Name was provided, use it.