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:
Wyrserth
2019-07-14 18:10:13 +02:00
parent e7cf24d263
commit 3db4fbbcef
@@ -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;
}