mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[10737] Use empty name for non-unique named pets.
This let to client select appropriate name by self base at UNIT_CREATED_BY_SPELL data.
This commit is contained in:
parent
5579471075
commit
1fe4b1f4bb
4 changed files with 5 additions and 18 deletions
|
|
@ -28,15 +28,6 @@
|
||||||
#include "Unit.h"
|
#include "Unit.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
|
||||||
char const* petTypeSuffix[MAX_PET_TYPE] =
|
|
||||||
{
|
|
||||||
"'s Minion", // SUMMON_PET
|
|
||||||
"'s Pet", // HUNTER_PET
|
|
||||||
"'s Guardian", // GUARDIAN_PET
|
|
||||||
"'s Companion", // PROTECTOR_PET
|
|
||||||
"'s Companion" // MINI_PET
|
|
||||||
};
|
|
||||||
|
|
||||||
Pet::Pet(PetType type) :
|
Pet::Pet(PetType type) :
|
||||||
Creature(CREATURE_SUBTYPE_PET),
|
Creature(CREATURE_SUBTYPE_PET),
|
||||||
m_resetTalentsCost(0), m_resetTalentsTime(0), m_usedTalentCount(0),
|
m_resetTalentsCost(0), m_resetTalentsTime(0), m_usedTalentCount(0),
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,6 @@ enum PetType
|
||||||
MAX_PET_TYPE = 5
|
MAX_PET_TYPE = 5
|
||||||
};
|
};
|
||||||
|
|
||||||
extern char const* petTypeSuffix[MAX_PET_TYPE];
|
|
||||||
|
|
||||||
#define MAX_PET_STABLES 4
|
#define MAX_PET_STABLES 4
|
||||||
|
|
||||||
// stored in character_pet.slot
|
// stored in character_pet.slot
|
||||||
|
|
|
||||||
|
|
@ -4250,9 +4250,7 @@ void Spell::DoSummon(SpellEffectIndex eff_idx)
|
||||||
spawnCreature->SetHealth(spawnCreature->GetMaxHealth());
|
spawnCreature->SetHealth(spawnCreature->GetMaxHealth());
|
||||||
spawnCreature->SetPower(POWER_MANA, spawnCreature->GetMaxPower(POWER_MANA));
|
spawnCreature->SetPower(POWER_MANA, spawnCreature->GetMaxPower(POWER_MANA));
|
||||||
|
|
||||||
std::string name = m_caster->GetName();
|
spawnCreature->SetName(""); // generated by client
|
||||||
name.append(petTypeSuffix[spawnCreature->getPetType()]);
|
|
||||||
spawnCreature->SetName( name );
|
|
||||||
|
|
||||||
map->Add((Creature*)spawnCreature);
|
map->Add((Creature*)spawnCreature);
|
||||||
|
|
||||||
|
|
@ -4668,6 +4666,7 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
|
||||||
if (duration > 0)
|
if (duration > 0)
|
||||||
spawnCreature->SetDuration(duration);
|
spawnCreature->SetDuration(duration);
|
||||||
|
|
||||||
|
spawnCreature->SetName(""); // generated by client
|
||||||
spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid());
|
spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid());
|
||||||
spawnCreature->setPowerType(POWER_MANA);
|
spawnCreature->setPowerType(POWER_MANA);
|
||||||
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npcflag);
|
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npcflag);
|
||||||
|
|
@ -7073,6 +7072,7 @@ void Spell::DoSummonTotem(SpellEffectIndex eff_idx, uint8 slot_dbc)
|
||||||
if (slot < MAX_TOTEM_SLOT)
|
if (slot < MAX_TOTEM_SLOT)
|
||||||
m_caster->_AddTotem(TotemSlot(slot),pTotem);
|
m_caster->_AddTotem(TotemSlot(slot),pTotem);
|
||||||
|
|
||||||
|
pTotem->SetName(""); // generated by client
|
||||||
pTotem->SetOwner(m_caster);
|
pTotem->SetOwner(m_caster);
|
||||||
pTotem->SetTypeBySummonSpell(m_spellInfo); // must be after Create call where m_spells initialized
|
pTotem->SetTypeBySummonSpell(m_spellInfo); // must be after Create call where m_spells initialized
|
||||||
|
|
||||||
|
|
@ -7584,6 +7584,7 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
critter->SetName(""); // generated by client
|
||||||
critter->SetOwnerGuid(m_caster->GetObjectGuid());
|
critter->SetOwnerGuid(m_caster->GetObjectGuid());
|
||||||
critter->SetCreatorGuid(m_caster->GetObjectGuid());
|
critter->SetCreatorGuid(m_caster->GetObjectGuid());
|
||||||
|
|
||||||
|
|
@ -7601,9 +7602,6 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
|
||||||
if(duration > 0)
|
if(duration > 0)
|
||||||
critter->SetDuration(duration);
|
critter->SetDuration(duration);
|
||||||
|
|
||||||
std::string name = player->GetName();
|
|
||||||
name.append(petTypeSuffix[critter->getPetType()]);
|
|
||||||
critter->SetName( name );
|
|
||||||
player->SetMiniPet(critter);
|
player->SetMiniPet(critter);
|
||||||
|
|
||||||
map->Add((Creature*)critter);
|
map->Add((Creature*)critter);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10736"
|
#define REVISION_NR "10737"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue