From 6cf76372ac334c3b4dff2d7be3d51f3334e3d7dd Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 24 Sep 2021 10:23:22 -0400 Subject: [PATCH] Core/Spells: Fix UNIT_CREATED_BY_SPELL in SPELL_EFFECT_SUMMON Port From (https://github.com/TrinityCore/TrinityCore/commit/69663cc94f8b90daa5f19192313d4c4129ba64cc) --- Source/Game/Entities/Object/WorldObject.cs | 6 +++--- Source/Game/Spells/SpellEffects.cs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 0783690fc..a5552e47c 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -1462,15 +1462,15 @@ namespace Game.Entities if (o == 0.0f) o = GetOrientation(); - return SummonCreature(entry, new Position(x, y, z, o), despawnType, despawnTime, 0, privateObjectOwner); + return SummonCreature(entry, new Position(x, y, z, o), despawnType, despawnTime, 0, 0, privateObjectOwner); } - public TempSummon SummonCreature(uint entry, Position pos, TempSummonType despawnType = TempSummonType.ManualDespawn, uint despawnTime = 0, uint vehId = 0, ObjectGuid privateObjectOwner = default) + public TempSummon SummonCreature(uint entry, Position pos, TempSummonType despawnType = TempSummonType.ManualDespawn, uint despawnTime = 0, uint vehId = 0, uint spellId = 0, ObjectGuid privateObjectOwner = default) { Map map = GetMap(); if (map != null) { - TempSummon summon = map.SummonCreature(entry, pos, null, despawnTime, ToUnit(), 0, vehId, privateObjectOwner); + TempSummon summon = map.SummonCreature(entry, pos, null, despawnTime, ToUnit(), spellId, vehId, privateObjectOwner); if (summon != null) { summon.SetTempSummonType(despawnType); diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 1f67e5615..3fcfe3138 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -1709,7 +1709,7 @@ namespace Game.Spells // randomize position for multiple summons pos = caster.GetRandomPoint(destTarget, radius); - summon = caster.SummonCreature(entry, pos, summonType, (uint)duration, 0, privateObjectOwner); + summon = caster.SummonCreature(entry, pos, summonType, (uint)duration, 0, m_spellInfo.Id, privateObjectOwner); if (summon == null) continue; @@ -1717,7 +1717,6 @@ namespace Game.Spells { summon.SetOwnerGUID(caster.GetGUID()); summon.SetFaction(caster.GetFaction()); - summon.SetCreatedBySpell(m_spellInfo.Id); } ExecuteLogEffectSummonObject(effectInfo.Effect, summon);