Core/Spells: Take SummonProperties into account for SPELL_EFFECT_SUMMONs with default SummonTitle

Port From (https://github.com/TrinityCore/TrinityCore/commit/b6ec81fff808388d934f098546c7faad9105c975)
This commit is contained in:
hondacrx
2022-10-11 20:06:25 -04:00
parent b611244add
commit d1f5ca2f49
+2 -12
View File
@@ -1704,24 +1704,14 @@ namespace Game.Spells
// randomize position for multiple summons
pos = caster.GetRandomPoint(destTarget, radius);
summon = caster.SummonCreature(entry, pos, summonType, TimeSpan.FromMilliseconds(duration), 0, m_spellInfo.Id, privateObjectOwner);
summon = unitCaster.GetMap().SummonCreature(entry, pos, properties, (uint)duration, unitCaster, m_spellInfo.Id, 0, privateObjectOwner);
if (summon == null)
continue;
summon.SetTempSummonType(summonType);
if (properties.Control == SummonCategory.Ally)
summon.SetOwnerGUID(caster.GetGUID());
uint faction = properties.Faction;
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.UseSummonerFaction)) // TODO: Determine priority between faction and flag
{
WorldObject summoner = summon.GetSummoner();
if (summoner != null)
faction = summoner.GetFaction();
}
if (faction != 0)
summon.SetFaction(faction);
ExecuteLogEffectSummonObject(effectInfo.Effect, summon);
}
return;