Core/BattlePets: Add battle pets to pet journal when learning related spells
This commit is contained in:
@@ -22,6 +22,7 @@ using Game.Network.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Game.BattlePets;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
@@ -2520,6 +2521,17 @@ namespace Game.Entities
|
||||
if (Global.DB2Mgr.GetMount(spellId) != null)
|
||||
GetSession().GetCollectionMgr().AddMount(spellId, MountStatusFlags.None, false, IsInWorld ? false : true);
|
||||
|
||||
// need to add Battle pets automatically into pet journal
|
||||
foreach (BattlePetSpeciesRecord entry in CliDB.BattlePetSpeciesStorage.Values)
|
||||
{
|
||||
if (entry.SummonSpellID == spellId && GetSession().GetBattlePetMgr().GetPetCount(entry.Id) == 0)
|
||||
{
|
||||
GetSession().GetBattlePetMgr().AddPet(entry.Id, entry.CreatureID, BattlePetMgr.RollPetBreed(entry.Id), BattlePetMgr.GetDefaultPetQuality(entry.Id));
|
||||
UpdateCriteria(CriteriaTypes.OwnBattlePetCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell
|
||||
return active && !disabled && !superceded_old;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user