Core/BattlePets: Misc fixes

Port From (https://github.com/TrinityCore/TrinityCore/commit/924182f692bde38d8fed85d5dbe7531a09790501)
This commit is contained in:
hondacrx
2022-01-07 13:20:16 -05:00
parent 56b2c4e0a4
commit e0340e7c07
7 changed files with 86 additions and 37 deletions
+8 -7
View File
@@ -188,12 +188,8 @@ namespace Game.Entities
Unit owner = GetSummonerUnit();
if (owner != null && IsTrigger() && m_spells[0] != 0)
{
SetLevel(owner.GetLevel());
if (owner.IsTypeId(TypeId.Player))
m_ControlledByPlayer = true;
}
if (m_Properties == null)
return;
@@ -211,15 +207,20 @@ namespace Game.Entities
}
owner.m_SummonSlot[slot] = GetGUID();
}
if (!m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.UseCreatureLevel))
SetLevel(owner.GetLevel());
}
uint faction = m_Properties.Faction;
if (m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.UseSummonerFaction)) // TODO: Determine priority between faction and flag
if (owner)
faction = owner.GetFaction();
if (owner && m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.UseSummonerFaction)) // TODO: Determine priority between faction and flag
faction = owner.GetFaction();
if (faction != 0)
SetFaction(faction);
if (m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
RemoveNpcFlag(NPCFlags.WildBattlePet);
}
public virtual void InitSummon()