mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +00:00
[11674] Fixed names of pets summoned by npc.
* Add check to make sure that creature controlled pet use default name from template. * Add localization support to pet name query for above pets type.
This commit is contained in:
parent
adcae44c9a
commit
d8a3f4b925
3 changed files with 19 additions and 4 deletions
|
|
@ -5651,14 +5651,15 @@ void Spell::EffectSummonPet(SpellEffectIndex eff_idx)
|
|||
NewSummon->InitLevelupSpellsForLevel();
|
||||
NewSummon->InitTalentForLevel();
|
||||
|
||||
if(NewSummon->getPetType() == SUMMON_PET)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->getPetType() == SUMMON_PET)
|
||||
{
|
||||
// generate new name for summon pet
|
||||
std::string new_name = sObjectMgr.GeneratePetName(petentry);
|
||||
if(!new_name.empty())
|
||||
if (!new_name.empty())
|
||||
NewSummon->SetName(new_name);
|
||||
}
|
||||
else if(NewSummon->getPetType() == HUNTER_PET)
|
||||
|
||||
if (NewSummon->getPetType() == HUNTER_PET)
|
||||
{
|
||||
NewSummon->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED);
|
||||
NewSummon->SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_ABANDONED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue