[8111] Implemented support for implicit specify owner when initializing stats for summoned pets.

* Speedup of summoning pets (no need to seach owner by guid)
* Fixed problem that summond pets from NPC had not initialized stats
  (pet was not in world in time of stat init thus owner was not found)

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-07-03 19:24:45 +02:00
parent 06dcbce4ee
commit aab121fcb2
4 changed files with 12 additions and 9 deletions

View file

@ -3275,7 +3275,7 @@ void Spell::EffectSummon(uint32 i)
spawnCreature->SetCreatorGUID(m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
spawnCreature->InitStatsForLevel(level);
spawnCreature->InitStatsForLevel(level, m_caster);
spawnCreature->GetCharmInfo()->SetPetNumber(pet_number, false);
@ -3705,7 +3705,7 @@ void Spell::EffectSummonGuardian(uint32 i)
spawnCreature->SetCreatorGUID(m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
spawnCreature->InitStatsForLevel(level);
spawnCreature->InitStatsForLevel(level, m_caster);
spawnCreature->GetCharmInfo()->SetPetNumber(pet_number, false);
spawnCreature->AIM_Initialize();
@ -4195,7 +4195,7 @@ void Spell::EffectSummonPet(uint32 i)
if(m_caster->IsPvP())
NewSummon->SetPvP(true);
NewSummon->InitStatsForLevel(petlevel);
NewSummon->InitStatsForLevel(petlevel, m_caster);
NewSummon->InitPetCreateSpells();
NewSummon->InitLevelupSpellsForLevel();
NewSummon->InitTalentForLevel();