mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 22:19:54 -04:00
Core/Pet: generate a new name for Death Knights' Ghouls when a new one is summoned.
Unlike Warlock pets, whose names are generated only once because they're the same demon that is summoned over and over, Death Knight pets are different entities generated from different corpses (or corpse dust). So each has their own, randomly generated, name.
This commit is contained in:
@@ -26563,6 +26563,14 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
if (duration > 0)
|
||||
pet->SetDuration(duration);
|
||||
|
||||
// Generate a new name for the newly summoned ghoul
|
||||
if (pet->IsPetGhoul())
|
||||
{
|
||||
std::string new_name = sObjectMgr->GeneratePetName(entry);
|
||||
if (!new_name.empty())
|
||||
pet->SetName(new_name);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user