Core/BattlePets: Fixes when adding pets
Port From (https://github.com/TrinityCore/TrinityCore/commit/7c15ec00c7c1a4d5bd3ce37de6776b8a407b65b7)
This commit is contained in:
@@ -1824,6 +1824,11 @@ namespace Game.Spells
|
||||
continue;
|
||||
|
||||
player.LearnSpell((uint)itemEffect.SpellID, false);
|
||||
|
||||
var speciesEntry = Global.SpellMgr.GetBattlePetSpecies((uint)itemEffect.SpellID);
|
||||
if (speciesEntry != null)
|
||||
player.GetSession().GetBattlePetMgr().AddPet(speciesEntry.Id, BattlePetMgr.SelectPetDisplay(speciesEntry), BattlePetMgr.RollPetBreed(speciesEntry.Id), BattlePetMgr.GetDefaultPetQuality(speciesEntry.Id));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5497,8 +5502,9 @@ namespace Game.Spells
|
||||
|
||||
battlePetMgr.AddPet(speciesId, displayId, breed, quality, level);
|
||||
|
||||
if (!plr.HasSpell(speciesEntry.SummonSpellID))
|
||||
plr.LearnSpell(speciesEntry.SummonSpellID, false);
|
||||
if (speciesEntry.SummonSpellID != 0)
|
||||
if (!plr.HasSpell(speciesEntry.SummonSpellID))
|
||||
plr.LearnSpell(speciesEntry.SummonSpellID, false);
|
||||
|
||||
plr.SendPlaySpellVisual(plr, SharedConst.SpellVisualUncagePet, 0, 0, 0.0f, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user